diff --git a/start.py b/start.py index 70823aa..a82aa15 100644 --- a/start.py +++ b/start.py @@ -63,9 +63,11 @@ def post(self): # 5.根据极验返回的用户验证状态, 网站主进行自己的业务逻辑 # 5. taking the user authentication status returned from geetest into consideration, the website owner follows his own business logic - if gt_msg['result'] == 'success': + if 'status' in gt_msg and gt_msg['status'] == 'error': + self.write({'login': 'exception', 'reason': gt_msg['msg']}) + elif 'result' in gt_msg and gt_msg['result'] == 'success': self.write({'login': 'success', 'reason': gt_msg['reason']}) - else: + elif 'result' in gt_msg and gt_msg['result'] == 'fail': self.write({'login': 'fail', 'reason': gt_msg['reason']})