try to fix relogin
This commit is contained in:
3
utils.py
3
utils.py
@ -83,6 +83,7 @@ class URP:
|
||||
for attempt in range(1, max_retries + 1):
|
||||
try:
|
||||
response = func()
|
||||
print(response.url)
|
||||
URP._judge_logout(response)
|
||||
return response
|
||||
except (
|
||||
@ -207,7 +208,7 @@ class URP:
|
||||
@staticmethod
|
||||
def _judge_logout(response: requests.Response):
|
||||
"""检查账号是否在其他地方被登录"""
|
||||
if "errorCode=concurrentSessionExpired" in response.url:
|
||||
if "/login" in response.url:
|
||||
raise ReloginException("有人登录了您的账号!")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user