Skip to content

Commit a1210d5

Browse files
committed
update:异步分片上传+更新提示
1 parent 5b7a9f9 commit a1210d5

File tree

5 files changed

+3138
-6
lines changed

5 files changed

+3138
-6
lines changed

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class ShareDataModel(BaseModel):
205205
exp_value: int
206206
type: str
207207
name: str
208-
key: str = uuid.uuid4().hex
208+
key: str = uuid.uuid4
209209

210210

211211
@app.post('/share/file/', dependencies=[Depends(admin_required)], description='分享文件')
@@ -231,7 +231,7 @@ async def share_text(text_model: ShareDataModel, s: AsyncSession = Depends(get_s
231231
if exp_error:
232232
raise HTTPException(status_code=400, detail='过期值异常')
233233
exp_status, exp_time, exp_count, code = await get_expire_info(text_model.exp_style, text_model.exp_value, s)
234-
size, _text, _type, name, key = len(text_model.text), text_model.text, 'text', '文本分享', text_model.key
234+
size, _text, _type, name, key = len(text_model.text), text_model.text, 'text', '文本分享', text_model.key().hex
235235
s.add(Codes(code=code, text=_text, size=size, type=_type, name=name, count=exp_count, exp_time=exp_time, key=key))
236236
await s.commit()
237237
upload_ip_limit.add_ip(ip)

0 commit comments

Comments
 (0)