diff --git a/common/constants.go b/common/constants.go
index a850b3e8..bd44d544 100644
--- a/common/constants.go
+++ b/common/constants.go
@@ -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
}
diff --git a/controller/channel-billing.go b/controller/channel-billing.go
index 4026e583..7ec688d9 100644
--- a/controller/channel-billing.go
+++ b/controller/channel-billing.go
@@ -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("尚未实现")
}
diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js
index 0b29ff9e..de27ac98 100644
--- a/web/src/components/ChannelsTable.js
+++ b/web/src/components/ChannelsTable.js
@@ -40,6 +40,8 @@ function renderBalance(type, balance) {
return ¥{balance.toFixed(2)};
case 13: // AIGC2D
return {renderNumber(balance)};
+ case 14: // GPTNiuX
+ return ${balance.toFixed(2)};
default:
return 不支持;
}
diff --git a/web/src/constants/channel.constants.js b/web/src/constants/channel.constants.js
index 7d732223..614a0ab4 100644
--- a/web/src/constants/channel.constants.js
+++ b/web/src/constants/channel.constants.js
@@ -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' }
];
\ No newline at end of file