Skip to content

Commit

Permalink
fix:文件大小变成字符串
Browse files Browse the repository at this point in the history
  • Loading branch information
vastsa authored Jun 17, 2024
1 parent 1300978 commit af83340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit af83340

Please sign in to comment.