Skip to content

Commit

Permalink
修改验证码判断条件以适应服务端的变动
Browse files Browse the repository at this point in the history
  • Loading branch information
huzhifeng committed Nov 30, 2014
1 parent 1456d46 commit ad0802c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py12306.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def login(self):
# {"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":"Y","messages":[],"validateMessages":{}}
# {"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":"N","messages":[],"validateMessages":{}}
obj = data2Json(data, ('status', 'httpstatus', 'data'))
if not (obj and obj['status'] and (obj['data'] == 'Y')):
if not (obj and obj['status'] and (obj['data']['result'] == '1')):
print(u"校验登录验证码失败")
if 'messages' in obj and obj['messages']: # 打印错误信息
print json.dumps(obj['messages'], ensure_ascii=False, indent=2)
Expand Down Expand Up @@ -1026,7 +1026,7 @@ def checkOrderInfo(self):
continue
# {"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":"Y","messages":[],"validateMessages":{}}
obj = data2Json(data, ('status', 'httpstatus', 'data'))
if not (obj and obj['status'] and (obj['data'] == 'Y')):
if not (obj and obj['status'] and (obj['data']['result'] == '1')):
print(u"校验订单验证码失败")
if 'messages' in obj and obj['messages']: # 打印错误信息
print json.dumps(obj['messages'], ensure_ascii=False, indent=2)
Expand Down

0 comments on commit ad0802c

Please sign in to comment.