获取下载token :param code: :return:
(code: str)
| 41 | |
| 42 | |
| 43 | async def get_select_token(code: str): |
| 44 | """ |
| 45 | 获取下载token |
| 46 | :param code: |
| 47 | :return: |
| 48 | """ |
| 49 | token = getattr(settings, "jwt_secret", "") |
| 50 | if not token: |
| 51 | raise RuntimeError("应用签名密钥未初始化") |
| 52 | return hashlib.sha256( |
| 53 | f"{code}{int(time.time() / 1000)}000{token}".encode() |
| 54 | ).hexdigest() |
| 55 | |
| 56 | |
| 57 | async def get_file_url(code: str): |
no outgoing calls
no test coverage detected