diff --git a/apps/admin/dependencies.py b/apps/admin/dependencies.py index 6aaf0579..04b97f82 100644 --- a/apps/admin/dependencies.py +++ b/apps/admin/dependencies.py @@ -9,7 +9,7 @@ async def admin_required(authorization: str = Header(default=None), request: Request = None): - is_admin = authorization.split(' ')[-1] if authorization else '' == str(settings.admin_token) + is_admin = (authorization.split(' ')[-1] if authorization else '') == settings.admin_token if request.url.path.startswith('/share/'): if not settings.openUpload and not is_admin: raise HTTPException(status_code=403, detail='本站未开启游客上传,如需上传请先登录后台')