Skip to content

Commit f9daa3c

Browse files
committed
update:去除取件判断过期删除
1 parent 9653845 commit f9daa3c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

main.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,7 @@ async def index(code: str, ip: str = Depends(error_ip_limit), s: AsyncSession =
107107
error_count = settings.ERROR_COUNT - error_ip_limit.add_ip(ip)
108108
raise HTTPException(status_code=404, detail=f"取件码错误,{error_count}次后将被禁止{settings.ERROR_MINUTE}分钟")
109109
if info.exp_time < datetime.datetime.now() or info.count == 0:
110-
if info.type != "text":
111-
await storage.delete_file(info.text)
112-
await s.delete(info)
113-
await s.commit()
114-
raise HTTPException(status_code=404, detail="取件码已过期,请联系寄件人")
110+
raise HTTPException(status_code=404, detail="取件码已失效,请联系寄件人")
115111
await s.execute(update(Codes).where(Codes.id == info.id).values(count=info.count - 1))
116112
await s.commit()
117113
if info.type != 'text':

0 commit comments

Comments
 (0)