feat: support channel type GPTNiuX
This commit is contained in:
parent
42c2ed5983
commit
84d9d42537
@ -149,6 +149,7 @@ const (
|
||||
ChannelTypePaLM = 11
|
||||
ChannelTypeAPI2GPT = 12
|
||||
ChannelTypeAIGC2D = 13
|
||||
ChannelTypeGPTNiuX = 14
|
||||
)
|
||||
|
||||
var ChannelBaseURLs = []string{
|
||||
@ -166,4 +167,5 @@ var ChannelBaseURLs = []string{
|
||||
"", // 11
|
||||
"https://api.api2gpt.com", // 12
|
||||
"https://api.aigc2d.com", // 13
|
||||
"https://api.gptniux.com", // 14
|
||||
}
|
||||
|
@ -192,6 +192,10 @@ func updateChannelBalance(channel *model.Channel) (float64, error) {
|
||||
return updateChannelAPI2GPTBalance(channel)
|
||||
case common.ChannelTypeAIGC2D:
|
||||
return updateChannelAIGC2DBalance(channel)
|
||||
case common.ChannelTypeGPTNiuX:
|
||||
if channel.BaseURL != "" {
|
||||
baseURL = channel.BaseURL
|
||||
}
|
||||
default:
|
||||
return 0, errors.New("尚未实现")
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ function renderBalance(type, balance) {
|
||||
return <span>¥{balance.toFixed(2)}</span>;
|
||||
case 13: // AIGC2D
|
||||
return <span>{renderNumber(balance)}</span>;
|
||||
case 14: // GPTNiuX
|
||||
return <span>${balance.toFixed(2)}</span>;
|
||||
default:
|
||||
return <span>不支持</span>;
|
||||
}
|
||||
|
@ -10,5 +10,6 @@ export const CHANNEL_OPTIONS = [
|
||||
{ key: 9, text: 'AI.LS', value: 9, color: 'yellow' },
|
||||
{ key: 10, text: 'AI Proxy', value: 10, color: 'purple' },
|
||||
{ key: 12, text: 'API2GPT', value: 12, color: 'blue' },
|
||||
{ key: 13, text: 'AIGC2D', value: 13, color: 'purple' }
|
||||
{ key: 13, text: 'AIGC2D', value: 13, color: 'purple' },
|
||||
{ key: 14, text: 'GPTNiuX', value: 14, color: 'orange' }
|
||||
];
|
Loading…
Reference in New Issue
Block a user