diff --git a/app/modules/filemanager/storages/u115.py b/app/modules/filemanager/storages/u115.py index fdbf99512..f86eb5162 100644 --- a/app/modules/filemanager/storages/u115.py +++ b/app/modules/filemanager/storages/u115.py @@ -71,6 +71,8 @@ def generate_qrcode(self) -> Optional[Tuple[dict, str]]: """ 生成二维码 """ + if not self.__init_cloud(): + return None try: resp = self.client.login_qrcode_token() self.session_info = resp["data"] @@ -89,9 +91,9 @@ def check_login(self) -> Optional[Tuple[dict, str]]: """ 二维码登录确认 """ + if not self.session_info: + return {}, "请先生成二维码!" try: - if not self.session_info: - return {}, "请先生成二维码!" resp = self.client.login_qrcode_scan_status(self.session_info) match resp["data"].get("status"): case 0: