Skip to content

Commit 7b37269

Browse files
committed
fix: 阻止将管理员口令置空
1 parent 2b3c524 commit 7b37269

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/admin/views.py

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ async def get_config():
4949

5050
@admin_api.patch('/config/update', dependencies=[Depends(admin_required)])
5151
async def update_config(data: dict):
52+
admin_token = data.get('admin_token')
53+
if admin_token is None or admin_token == '':
54+
return APIResponse(code=400, detail='管理员密码不能为空')
55+
5256
for k, v in data.items():
5357
settings.__setattr__(k, v)
5458
return APIResponse()

0 commit comments

Comments
 (0)