From 77bc0d1dde0ab33b9d91e633deb4361cd5c031cb Mon Sep 17 00:00:00 2001 From: dylanhdy <40438517@qq.com> Date: Sat, 22 Feb 2025 13:45:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=81=BF=E5=85=8Dtoken=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gateway/chatgpt.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gateway/chatgpt.py b/gateway/chatgpt.py index 8ed9afd..31f5bbc 100644 --- a/gateway/chatgpt.py +++ b/gateway/chatgpt.py @@ -7,6 +7,8 @@ from app import app, templates from gateway.login import login_html from utils.kv_utils import set_value_for_key +import utils.configs as configs +import utils.globals as globals with open("templates/chatgpt_context.json", "r", encoding="utf-8") as f: chatgpt_context = json.load(f) @@ -22,6 +24,8 @@ async def chatgpt_html(request: Request): if len(token) != 45 and not token.startswith("eyJhbGciOi"): token = quote(token) + if configs.auto_seed == False and token not in globals.seed_map.keys(): + return await login_html(request) user_remix_context = chatgpt_context.copy() set_value_for_key(user_remix_context, "user", {"id": "user-chatgpt"})