From b3502845d8dd24398c776cd73699d0ac316b196f Mon Sep 17 00:00:00 2001 From: Akimio521 Date: Fri, 1 Nov 2024 11:47:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(AlistClient):=20=E4=BF=AE=E5=A4=8Dsync=5Fap?= =?UTF-8?q?i=5Fauth=5Flogin=E4=B8=ADSession()=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/alist/v3/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/alist/v3/client.py b/app/api/alist/v3/client.py index b08759a..35d3a61 100644 --- a/app/api/alist/v3/client.py +++ b/app/api/alist/v3/client.py @@ -113,7 +113,9 @@ def sync_api_auth_login(self) -> str: data = dumps({"username": self.username, "password": self.__password}) api_url = self.url + "/api/auth/login" - resp = Session(headers=self.__HEADERS).post(api_url, data=data) + session = Session() + session.headers.update(self.__get_header_with_token) + resp = session.post(api_url, data=data) if resp.status_code != 200: raise RuntimeError(f"登录请求发送失败,状态码:{resp.status_code}")