Skip to content

Commit f1e19f8

Browse files
committed
fix: some bug
1 parent 199478d commit f1e19f8

8 files changed

Lines changed: 2009 additions & 6 deletions

File tree

chat2db-client/src/blocks/Setting/AiSetting/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export default function SettingAI(props: IProps) {
3030
if (newChatGPTConfig.apiHost && !newChatGPTConfig.apiHost?.endsWith('/')) {
3131
newChatGPTConfig.apiHost = newChatGPTConfig.apiHost + '/';
3232
}
33+
if (chatGPTConfig?.aiSqlSource === AiSqlSourceType.CHAT2DBAI) {
34+
newChatGPTConfig.apiHost = `${window._appGatewayParams.baseUrl || 'http://test.sqlgpt.cn/gateway/'}api/`
35+
}
3336
configService.setChatGptSystemConfig(newChatGPTConfig).then((res) => {
3437
message.success(i18n('common.text.submittedSuccessfully'));
3538
});
@@ -51,13 +54,13 @@ export default function SettingAI(props: IProps) {
5154
}}
5255
value={chatGPTConfig?.aiSqlSource}
5356
>
54-
<Radio value={AiSqlSourceType.CHAT2DB}>Chat2DB AI</Radio>
57+
<Radio value={AiSqlSourceType.CHAT2DBAI}>Chat2DB AI</Radio>
5558
<Radio value={AiSqlSourceType.OPENAI}>Open AI</Radio>
5659
<Radio value={AiSqlSourceType.AZUREAI}>Azure AI</Radio>
5760
<Radio value={AiSqlSourceType.RESTAI}>{i18n('setting.tab.custom')}</Radio>
5861
</Radio.Group>
5962
</div>
60-
{chatGPTConfig?.aiSqlSource === AiSqlSourceType.CHAT2DB && (
63+
{chatGPTConfig?.aiSqlSource === AiSqlSourceType.CHAT2DBAI && (
6164
<div>
6265
<div className={styles.title}>Api Key</div>
6366
<div className={classnames(styles.content, styles.chatGPTKey)}>

0 commit comments

Comments
 (0)