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(