From 802d2551ff52ce5938d2770cc13075219fd04eda Mon Sep 17 00:00:00 2001 From: Lan Date: Mon, 10 Feb 2025 19:12:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/views.py | 2 +- core/settings.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/admin/views.py b/apps/admin/views.py index 5d0aae1..515f0c1 100644 --- a/apps/admin/views.py +++ b/apps/admin/views.py @@ -19,7 +19,7 @@ admin_api = APIRouter(prefix='/admin', tags=['管理']) @admin_api.post('/login') async def login(data: LoginData): # 验证管理员密码 - if data.password != settings.admin_password: + if data.password != settings.admin_token: raise HTTPException(status_code=401, detail="密码错误") # 生成包含管理员身份的token diff --git a/core/settings.py b/core/settings.py index c66177d..20709db 100644 --- a/core/settings.py +++ b/core/settings.py @@ -36,8 +36,6 @@ DEFAULT_CONFIG = { 'onedrive_root_path': 'filebox_storage', 'onedrive_proxy': 0, 'webdav_hostname': '', - 'webdav_username': '', - 'webdav_password': '', 'webdav_root_path': 'filebox_storage', 'webdav_proxy': 0, 'admin_token': 'FileCodeBox2023', @@ -71,9 +69,6 @@ DEFAULT_CONFIG = { 'port': 12345, 'showAdminAddr': 0, 'robotsText': 'User-agent: *\nDisallow: /', - 'jwt_secret_key': "your-secret-key", # 建议使用环境变量 - 'jwt_algorithm': "HS256", - 'admin_password': 'FileCodeBox2023', # 建议使用环境变量存储 }