From e415e814ed82347971b3b5f4670ad30ada4630a4 Mon Sep 17 00:00:00 2001 From: vastsa <48862574+vastsa@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:16:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=8F=98=E6=88=90=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/base/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/base/views.py b/apps/base/views.py index 9db69d9..af48d92 100644 --- a/apps/base/views.py +++ b/apps/base/views.py @@ -47,7 +47,7 @@ async def share_text(text: str = Form(...), expire_value: int = Form(default=1, @share_api.post('/file/', dependencies=[Depends(admin_required)]) async def share_file(expire_value: int = Form(default=1, gt=0), expire_style: str = Form(default='day'), file: UploadFile = File(...), ip: str = Depends(upload_ip_limit)): # 检查文件大小是否超过限制 - if file.size > settings.uploadSize: + if file.size > int(settings.uploadSize): raise HTTPException(status_code=403, detail=f'文件大小超过限制,最大为{settings.uploadSize}字节') # 获取过期信息 if expire_style not in settings.expireStyle: