From 115413dcaf15ea9c104c90ccb56cef8ace4ce473 Mon Sep 17 00:00:00 2001 From: "dmitrii.mashkov" Date: Tue, 17 Oct 2023 16:57:50 +0200 Subject: [PATCH 1/2] fix(start): fix post handler Process response according https://docs.geetest.com/BehaviorVerification/deploy/server/#Response-parameters --- start.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/start.py b/start.py index 70823aa..224be83 100644 --- a/start.py +++ b/start.py @@ -17,7 +17,7 @@ def get(self): def post(self): # 1.初始化极验参数信息 # 1.initialize geetest parameter - captcha_id = '647f5ed2ed8acb4be36784e01556bb71' + captcha_id = '647f5ed2ed8acb4be36784e01553456bb71' captcha_key = 'b09a7aafbfd83f73b35a9b530d0337bf' api_server = 'http://gcaptcha4.geetest.com' @@ -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']}) From 7489743e89c5a4953a50710f30eba59c65d75925 Mon Sep 17 00:00:00 2001 From: "dmitrii.mashkov" Date: Tue, 17 Oct 2023 17:01:14 +0200 Subject: [PATCH 2/2] fix(start): fix post handler Process response according https://docs.geetest.com/BehaviorVerification/deploy/server/#Response-parameters --- start.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.py b/start.py index 224be83..a82aa15 100644 --- a/start.py +++ b/start.py @@ -17,7 +17,7 @@ def get(self): def post(self): # 1.初始化极验参数信息 # 1.initialize geetest parameter - captcha_id = '647f5ed2ed8acb4be36784e01553456bb71' + captcha_id = '647f5ed2ed8acb4be36784e01556bb71' captcha_key = 'b09a7aafbfd83f73b35a9b530d0337bf' api_server = 'http://gcaptcha4.geetest.com'