mirror of
https://github.com/lanqian528/chat2api.git
synced 2026-06-13 21:02:46 +08:00
v1.5.1
This commit is contained in:
parent
551c22c470
commit
1e2a1423b1
@ -16,7 +16,7 @@ from chatgpt.authorization import refresh_all_tokens, verify_token, get_req_toke
|
||||
import chatgpt.globals as globals
|
||||
from chatgpt.reverseProxy import chatgpt_reverse_proxy
|
||||
from utils.Logger import logger
|
||||
from utils.config import api_prefix, scheduled_refresh, authorization_list
|
||||
from utils.config import api_prefix, scheduled_refresh, authorization_list, enable_gateway
|
||||
from utils.retry import async_retry
|
||||
|
||||
warnings.filterwarnings("ignore")
|
||||
@ -130,6 +130,8 @@ async def error_tokens():
|
||||
|
||||
@app.get("/")
|
||||
async def chatgpt(request: Request):
|
||||
if not enable_gateway:
|
||||
raise HTTPException(status_code=404, detail="Gateway is disabled")
|
||||
req_token = get_req_token(authorization_list[0])
|
||||
access_token = await verify_token(req_token)
|
||||
response = templates.TemplateResponse("chatgpt.html", {"request": request, "access_token": access_token})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user