add:vue-i18n,admin add file size

This commit is contained in:
lan
2023-09-06 11:06:18 +08:00
parent 5d08819529
commit dcdad7ce2e
40 changed files with 770 additions and 427 deletions
+5 -3
View File
@@ -39,7 +39,8 @@ async def get_now():
datetime.timezone(datetime.timedelta(hours=8))
)
async def get_select_token(code: int):
async def get_select_token(code: str):
"""
获取下载token
:param code:
@@ -48,10 +49,11 @@ async def get_select_token(code: int):
token = "123456"
return hashlib.sha256(f"{code}{int(time.time() / 1000)}000{token}".encode()).hexdigest()
async def get_file_url(code: int):
async def get_file_url(code: str):
"""
对于需要通过服务器中转下载的服务,获取文件下载地址
:param code:
:return:
"""
return f'/share/download?key={await get_select_token(code)}&code={code}'
return f'/share/download?key={await get_select_token(code)}&code={code}'