File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33< head >
44 < meta charset ="UTF-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6- < title > Google OAuth 认证管理 </ title >
6+ < title > GCLI2API 控制面板 </ title >
77 < style >
88 body {
99 font-family : Arial, sans-serif;
Original file line number Diff line number Diff line change 1919 load_credentials_from_env , clear_env_credentials
2020)
2121from .credential_manager import CredentialManager
22- from config import (
23- get_config_value
24- )
22+ import config
2523
2624# 创建路由器
2725router = APIRouter ()
@@ -101,6 +99,7 @@ def verify_token(credentials: HTTPAuthorizationCredentials = Depends(security)):
10199 raise HTTPException (status_code = 401 , detail = "无效的认证令牌" )
102100 return credentials .credentials
103101
102+ @router .get ("/" , response_class = HTMLResponse )
104103@router .get ("/auth" , response_class = HTMLResponse )
105104async def serve_control_panel ():
106105 """提供统一控制面板(包含认证、文件管理、配置等功能)"""
Original file line number Diff line number Diff line change @@ -93,24 +93,6 @@ async def lifespan(app: FastAPI):
9393 tags = ["Web Interface" ]
9494)
9595
96- @app .get ("/" )
97- async def root ():
98- """根路径 - 服务状态信息"""
99- return {
100- "service" : "GCLI2API" ,
101- "status" : "running" ,
102- "endpoints" : {
103- "openai_api" : "/v1/chat/completions" ,
104- "openai_models" : "/v1/models" ,
105- "gemini_api" : "/v1/models/{model}:generateContent" ,
106- "gemini_streaming" : "/v1/models/{model}:streamGenerateContent" ,
107- "gemini_models" : "/v1/models" ,
108- "control_panel" : "/auth" ,
109- },
110- "docs" : "/docs" ,
111- "credential_manager" : "initialized" if global_credential_manager else "failed"
112- }
113-
11496def get_credential_manager ():
11597 """获取全局凭证管理器实例"""
11698 return global_credential_manager
You can’t perform that action at this time.
0 commit comments