修复gemini接口,添加豆包接口

This commit is contained in:
skestar
2025-08-02 22:46:57 +08:00
parent 160d716fbe
commit aef6e2abef
12 changed files with 420 additions and 11 deletions

View File

@@ -381,6 +381,7 @@ class SettingsManager {
'DeepseekApiKey': '',
'AlibabaApiKey': '',
'GoogleApiKey': '',
'DoubaoApiKey': '',
'MathpixAppId': '',
'MathpixAppKey': ''
};
@@ -391,7 +392,8 @@ class SettingsManager {
'OpenaiApiBaseUrl': '',
'DeepseekApiBaseUrl': '',
'AlibabaApiBaseUrl': '',
'GoogleApiBaseUrl': ''
'GoogleApiBaseUrl': '',
'DoubaoApiBaseUrl': ''
};
// 加载模型配置
@@ -759,6 +761,8 @@ class SettingsManager {
apiKeyToHighlight = document.querySelector('.api-key-status:nth-child(4)'); // Alibaba
} else if (modelType && (modelType.toLowerCase().includes('gemini') || modelType.toLowerCase().includes('google'))) {
apiKeyToHighlight = document.querySelector('.api-key-status:nth-child(5)'); // Google
} else if (modelType && modelType.toLowerCase().includes('doubao')) {
apiKeyToHighlight = document.querySelector('.api-key-status:nth-child(6)'); // 豆包
}
if (apiKeyToHighlight) {
@@ -869,6 +873,9 @@ class SettingsManager {
if (this.apiBaseUrlValues['GoogleApiBaseUrl']) {
apiBaseUrls.google = this.apiBaseUrlValues['GoogleApiBaseUrl'];
}
if (this.apiBaseUrlValues['DoubaoApiBaseUrl']) {
apiBaseUrls.doubao = this.apiBaseUrlValues['DoubaoApiBaseUrl'];
}
}
return {
@@ -2260,6 +2267,7 @@ class SettingsManager {
'DeepseekApiKey': '',
'AlibabaApiKey': '',
'GoogleApiKey': '',
'DoubaoApiKey': '',
'MathpixAppId': '',
'MathpixAppKey': ''
};
@@ -2359,7 +2367,8 @@ class SettingsManager {
'OpenaiApiBaseUrl': proxyApiConfig.apis?.openai || '',
'DeepseekApiBaseUrl': proxyApiConfig.apis?.deepseek || '',
'AlibabaApiBaseUrl': proxyApiConfig.apis?.alibaba || '',
'GoogleApiBaseUrl': proxyApiConfig.apis?.google || ''
'GoogleApiBaseUrl': proxyApiConfig.apis?.google || '',
'DoubaoApiBaseUrl': proxyApiConfig.apis?.doubao || ''
};
this.updateApiBaseUrlStatus(apiBaseUrls);
console.log('API基础URL状态已刷新');
@@ -2449,6 +2458,9 @@ class SettingsManager {
case 'GoogleApiBaseUrl':
config.apis.google = value;
break;
case 'DoubaoApiBaseUrl':
config.apis.doubao = value;
break;
}
// 确保启用中转API