From 529f314856d17cbf93d977c85d8d364cdfbb4660 Mon Sep 17 00:00:00 2001 From: Lan <48862574+vastsa@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E8=A6=81=E6=9B=B4=E6=96=B0=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E5=AF=86=E7=A0=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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='本站未开启游客上传,如需上传请先登录后台')