mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-10-21 16:27:15 +08:00
🐛 修复stoken绑定问题
This commit is contained in:
parent
fb5e409f5d
commit
57dc3200ec
@ -169,26 +169,21 @@ async def addStoken(stoken, uid):
|
|||||||
login_ticket = login_ticket.group(0).split('=')[1]
|
login_ticket = login_ticket.group(0).split('=')[1]
|
||||||
else:
|
else:
|
||||||
return None, None, None, '你的cookie中没有login_ticket字段哦,请重新获取'
|
return None, None, None, '你的cookie中没有login_ticket字段哦,请重新获取'
|
||||||
# logger.info(login_ticket)
|
|
||||||
# mys_id = re.search(r'login_uid=([0-9]+)', mes).group(0).split('=')[1]
|
|
||||||
ck = await get_private_cookie(uid, key='uid')
|
ck = await get_private_cookie(uid, key='uid')
|
||||||
# logger.info(ck)
|
|
||||||
if not ck:
|
if not ck:
|
||||||
return None, None, None, '你还没绑定私人cookie哦,请先用ysb绑定吧'
|
return None, None, None, '你还没绑定私人cookie哦,请先用ysb绑定吧'
|
||||||
ck = ck[0][1]
|
ck = ck[0][1]
|
||||||
mys_id = re.search(r'account_id=(\d*)', ck).group(0).split('=')[1]
|
mys_id = re.search(r'account_id=(\d*)', ck)
|
||||||
# logger.info("run1")
|
if mys_id:
|
||||||
# logger.info(mys_id)
|
mys_id = mys_id.group(0).split('=')[1]
|
||||||
|
else:
|
||||||
|
return None, None, None, '你的cookie中没有account_id字段哦,请重新获取'
|
||||||
raw_data = await get_stoken_by_login_ticket(login_ticket, mys_id)
|
raw_data = await get_stoken_by_login_ticket(login_ticket, mys_id)
|
||||||
# logger.info(raw_data)
|
|
||||||
# logger.info("run2")
|
|
||||||
try:
|
try:
|
||||||
stoken = raw_data['data']['list'][0]['token']
|
stoken = raw_data['data']['list'][0]['token']
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return None, None, None, '该stoken无效获取过期了,请重新获取'
|
return None, None, None, '该stoken无效获取过期了,请重新获取'
|
||||||
# logger.info("run3")
|
|
||||||
s_cookies = 'stuid={};stoken={}'.format(mys_id, stoken)
|
s_cookies = 'stuid={};stoken={}'.format(mys_id, stoken)
|
||||||
# logger.info(s_cookies)
|
|
||||||
return s_cookies, mys_id, raw_data, 'OK'
|
return s_cookies, mys_id, raw_data, 'OK'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user