From 8efb5f9c5a2665c36b021fc53131d9483ce8e90f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Mon, 26 Apr 2021 16:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alipay/Aliverify.php | 15 +++------------ app/api/controller/Test.php | 11 +++++++---- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/alipay/Aliverify.php b/alipay/Aliverify.php index 21ac673..2a79000 100644 --- a/alipay/Aliverify.php +++ b/alipay/Aliverify.php @@ -2,9 +2,6 @@ namespace alipay; - -use app\api\model\User; - require_once APP_PATH . 'alipay/aop/AopCertClient.php'; require_once APP_PATH . 'alipay/aop/AopCertification.php'; require_once APP_PATH . 'alipay/aop/request/AlipayUserCertifyOpenInitializeRequest.php'; @@ -55,7 +52,7 @@ class Aliverify $newsigndata['identity_param']['cert_type']="IDENTITY_CARD"; $newsigndata['identity_param']['cert_name']=$res['name']; $newsigndata['identity_param']['cert_no']= $res['id_code']; - $newsigndata['merchant_config']['return_url']="http://www.juip.com/User/Index"; + $newsigndata['merchant_config']['return_url']="http://www.juip.com/User/Index?realname=true"; $newsigndata['face_contrast_picture']="xydasf=="; $tosign=json_encode($newsigndata); $request->setBizContent($tosign); @@ -80,7 +77,7 @@ class Aliverify } } - public static function getResult($certify_id,$id) + public static function getResult($certify_id) { global $config; $aop = new \AopCertClient(); @@ -109,13 +106,7 @@ class Aliverify $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; $resultCode = $result->$responseNode->passed; if($resultCode == 'T'){ - $user = new User; - $user_data['is_verify'] = 1; - if($user->updateOne(['Id'=>$id],$user_data)){ - return true; - }else { - return false; - } + return true; } else { return false; } diff --git a/app/api/controller/Test.php b/app/api/controller/Test.php index 63d3ce6..523142b 100644 --- a/app/api/controller/Test.php +++ b/app/api/controller/Test.php @@ -60,12 +60,15 @@ class Test extends Controller { $user = new User; $user_one_info = $user->getOne(['Id'=>$this->userinfo['UserId']]); - $info = Aliverify::getResult($user_one_info['certify_id'],$this->userinfo['UserId']); + $info = Aliverify::getResult($user_one_info['certify_id']); $data = []; if($info){ - $data = [ - 'Code'=>10000 - ]; + $user_data['is_verify'] = 1; + if($user->updateOne(['Id'=>$this->userinfo['UserId']],$user_data)){ + $data = [ + 'Code'=>10000 + ]; + } } else { $data = [ 'Code'=>-10000