fix: 密码修改失败问题

This commit is contained in:
Lan
2025-02-10 19:12:04 +08:00
parent 98721b7587
commit 7b0ea804cf
2 changed files with 1 additions and 6 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ admin_api = APIRouter(prefix='/admin', tags=['管理'])
@admin_api.post('/login') @admin_api.post('/login')
async def login(data: LoginData): async def login(data: LoginData):
# 验证管理员密码 # 验证管理员密码
if data.password != settings.admin_password: if data.password != settings.admin_token:
raise HTTPException(status_code=401, detail="密码错误") raise HTTPException(status_code=401, detail="密码错误")
# 生成包含管理员身份的token # 生成包含管理员身份的token
-5
View File
@@ -36,8 +36,6 @@ DEFAULT_CONFIG = {
'onedrive_root_path': 'filebox_storage', 'onedrive_root_path': 'filebox_storage',
'onedrive_proxy': 0, 'onedrive_proxy': 0,
'webdav_hostname': '', 'webdav_hostname': '',
'webdav_username': '',
'webdav_password': '',
'webdav_root_path': 'filebox_storage', 'webdav_root_path': 'filebox_storage',
'webdav_proxy': 0, 'webdav_proxy': 0,
'admin_token': 'FileCodeBox2023', 'admin_token': 'FileCodeBox2023',
@@ -71,9 +69,6 @@ DEFAULT_CONFIG = {
'port': 12345, 'port': 12345,
'showAdminAddr': 0, 'showAdminAddr': 0,
'robotsText': 'User-agent: *\nDisallow: /', 'robotsText': 'User-agent: *\nDisallow: /',
'jwt_secret_key': "your-secret-key", # 建议使用环境变量
'jwt_algorithm': "HS256",
'admin_password': 'FileCodeBox2023', # 建议使用环境变量存储
} }