From 8aed2b334e5184bed16250b691fc50ee9015fc97 Mon Sep 17 00:00:00 2001 From: Akimio521 Date: Sat, 25 Jan 2025 22:31:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=B0=B8=E4=B9=85=E4=BB=A4=E7=89=8C=E8=BF=9B=E8=A1=8C=E8=AE=A4?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/filemanager/storages/alist.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/modules/filemanager/storages/alist.py b/app/modules/filemanager/storages/alist.py index 023c7a20..810254fa 100644 --- a/app/modules/filemanager/storages/alist.py +++ b/app/modules/filemanager/storages/alist.py @@ -70,10 +70,13 @@ class Alist(StorageBase, metaclass=Singleton): @cached(maxsize=1, ttl=60 * 60 * 24 * 2 - 60 * 5) def __generate_token(self) -> str: """ - 使用账号密码生成一个临时token + 如果设置永久令牌则返回永久令牌,否则使用账号密码生成一个临时 token 缓存2天,提前5分钟更新 """ conf = self.get_conf() + token = conf.get("token") + if token: + return str(token) resp: Response = RequestUtils(headers={ 'Content-Type': 'application/json' }).post_res(