mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-20 03:30:50 +08:00
fix(webui): normalize gemini endpoint and oauth callback status
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,6 +17,7 @@ dist-ssr
|
|||||||
*.local
|
*.local
|
||||||
|
|
||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
|
settings.local.json
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
.idea
|
.idea
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ export function OAuthPage() {
|
|||||||
{t('auth_login.oauth_callback_button')}
|
{t('auth_login.oauth_callback_button')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{state.callbackStatus === 'success' && (
|
{state.callbackStatus === 'success' && state.status === 'waiting' && (
|
||||||
<div className="status-badge success" style={{ marginTop: 8 }}>
|
<div className="status-badge success" style={{ marginTop: 8 }}>
|
||||||
{t('auth_login.oauth_callback_status_success')}
|
{t('auth_login.oauth_callback_status_success')}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -82,6 +82,10 @@ class ApiClient {
|
|||||||
(config) => {
|
(config) => {
|
||||||
// 设置 baseURL
|
// 设置 baseURL
|
||||||
config.baseURL = this.apiBase;
|
config.baseURL = this.apiBase;
|
||||||
|
if (config.url) {
|
||||||
|
// Normalize deprecated Gemini endpoint to the current path.
|
||||||
|
config.url = config.url.replace(/\/generative-language-api-key\b/g, '/gemini-api-key');
|
||||||
|
}
|
||||||
|
|
||||||
// 添加认证头
|
// 添加认证头
|
||||||
if (this.managementKey) {
|
if (this.managementKey) {
|
||||||
|
|||||||
Reference in New Issue
Block a user