This commit is contained in:
jxxghp
2024-09-14 12:20:22 +08:00
parent 5a6733fa32
commit 5229a0173a
2 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -206,7 +206,7 @@ class Settings(BaseSettings):
def validate_api_token(cls, v):
if not v:
new_token = secrets.token_urlsafe(16)
logger.info(f"API_TOKEN 未设置,已随机生成新的 API_TOKEN:{new_token}")
logger.info(f"API_TOKEN未设置,已随机生成新的 API_TOKEN:{new_token}")
set_key(str(SystemUtils.get_env_path()), "API_TOKEN", new_token)
return new_token
elif len(v) < 16: