Skip to content

Commit

Permalink
fix(AlistClient): 修复sync_api_auth_login中Session()的错误使用
Browse files Browse the repository at this point in the history
  • Loading branch information
Akimio521 committed Nov 1, 2024
1 parent 07a9be2 commit b350284
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/api/alist/v3/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit b350284

Please sign in to comment.