Kaynağa Gözat

fix: fix not using proxy when update balance

JustSong 2 yıl önce
ebeveyn
işleme
145bb14cb2
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      controller/channel-billing.go

+ 3 - 1
controller/channel-billing.go

@@ -41,7 +41,9 @@ func updateChannelBalance(channel *model.Channel) (float64, error) {
 	baseURL := common.ChannelBaseURLs[channel.Type]
 	switch channel.Type {
 	case common.ChannelTypeOpenAI:
-		// do nothing
+		if channel.BaseURL != "" {
+			baseURL = channel.BaseURL
+		}
 	case common.ChannelTypeAzure:
 		return 0, errors.New("尚未实现")
 	case common.ChannelTypeCustom: