fix: bug fix

This commit is contained in:
JustSong 2023-07-03 20:39:57 +08:00
parent 6583ade2e2
commit fef04baca1
2 changed files with 4 additions and 0 deletions

View File

@ -198,6 +198,9 @@ func updateChannelAIGC2DBalance(channel *model.Channel) (float64, error) {
func updateChannelBalance(channel *model.Channel) (float64, error) { func updateChannelBalance(channel *model.Channel) (float64, error) {
baseURL := common.ChannelBaseURLs[channel.Type] baseURL := common.ChannelBaseURLs[channel.Type]
if channel.BaseURL == "" {
channel.BaseURL = baseURL
}
switch channel.Type { switch channel.Type {
case common.ChannelTypeOpenAI: case common.ChannelTypeOpenAI:
if channel.BaseURL != "" { if channel.BaseURL != "" {

View File

@ -30,6 +30,7 @@ function renderType(type) {
function renderBalance(type, balance) { function renderBalance(type, balance) {
switch (type) { switch (type) {
case 1: // OpenAI case 1: // OpenAI
return <span>${balance.toFixed(2)}</span>;
case 4: // CloseAI case 4: // CloseAI
return <span>¥{balance.toFixed(2)}</span>; return <span>¥{balance.toFixed(2)}</span>;
case 8: // 自定义 case 8: // 自定义