Skip to content

Commit

Permalink
Update api.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chen310 authored Mar 16, 2022
1 parent c326ae8 commit 751f783
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def request(self, method, path, params={}, base_url=BASE_URL, default={"code": -
def login(self, username, password, countrycode='86'):
username = str(username)
cookie_file = self.get_cookie_file(username)
if len(cookie_file) > 0:
if cookie_file:
if self.username != username:
cookie_jar = LWPCookieJar(cookie_file)
cookie_jar.load()
Expand All @@ -150,7 +150,7 @@ def login(self, username, password, countrycode='86'):
rememberLogin="true", clientToken=client_token)
data = self.request("POST", path, params)

if len(cookie_file) > 0:
if cookie_file:
self.session.cookies.save()
return data

Expand Down

0 comments on commit 751f783

Please sign in to comment.