feat: 为API添加统一的鉴权token

This commit is contained in:
yinpeng
2024-12-25 01:26:39 +08:00
parent 9d5a99583d
commit 9578704cfd
4 changed files with 26 additions and 8 deletions
+7 -1
View File
@@ -10,7 +10,13 @@ class Settings(BaseSettings):
TOOLS_CODE_EXECUTION_ENABLED: bool = False
SHOW_SEARCH_LINK: bool = True
SHOW_THINKING_PROCESS: bool = True
AUTH_TOKEN: str
def __init__(self):
super().__init__()
if not self.AUTH_TOKEN:
self.AUTH_TOKEN = self.ALLOWED_TOKENS[0] if self.ALLOWED_TOKENS else ""
class Config:
env_file = ".env"