1、修改登录接口逻辑,暂定办法

2、修改邮箱554 bug
pull/23/head
wenxianping 2018-01-22 22:01:57 +08:00
parent b37aadfc93
commit b36595aead
3 changed files with 12 additions and 7 deletions

View File

@ -23,7 +23,7 @@ def sendEmail(msg):
host = email_conf["email_conf"]["host"]
s = "{0}".format(msg)
msg = MIMEText(s, 'text', 'utf-8') # 中文需参数utf-8单字节字符不需要
msg = MIMEText(s, 'plain', 'utf-8') # 中文需参数utf-8单字节字符不需要
msg['Subject'] = Header(subject, 'utf-8')
msg['From'] = sender
msg['To'] = receiver

View File

@ -166,11 +166,16 @@ class GoLogin:
uamauthclientUrl = self.urlConf["uamauthclient"]["req_url"]
data = {"tk": uamtk}
uamauthclientResult = self.httpClint.send(uamauthclientUrl, data)
if "result_code" in uamauthclientResult and uamauthclientResult["result_code"] == 0:
print("欢迎 {} 登录".format(uamauthclientResult["username"]))
return True
if uamauthclientResult:
if "result_code" in uamauthclientResult and uamauthclientResult["result_code"] == 0:
print("欢迎 {} 登录".format(uamauthclientResult["username"]))
return True
else:
return False
else:
return False
self.httpClint.send(uamauthclientUrl, data)
url = self.urlConf["getUserInfo"]["req_url"]
self.httpClint.send(url)
def go_login(self):
"""
@ -192,8 +197,8 @@ class GoLogin:
if self.codeCheck():
uamtk = self.baseLogin(user, passwd)
if uamtk:
if self.getUserName(uamtk):
break
self.getUserName(uamtk)
break
def logout(self):
url = 'https://kyfw.12306.cn/otn/login/loginOut'

BIN
tkcode

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB