实名认证
This commit is contained in:
@@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace alipay;
|
namespace alipay;
|
||||||
|
|
||||||
|
|
||||||
use app\api\model\User;
|
|
||||||
|
|
||||||
require_once APP_PATH . 'alipay/aop/AopCertClient.php';
|
require_once APP_PATH . 'alipay/aop/AopCertClient.php';
|
||||||
require_once APP_PATH . 'alipay/aop/AopCertification.php';
|
require_once APP_PATH . 'alipay/aop/AopCertification.php';
|
||||||
require_once APP_PATH . 'alipay/aop/request/AlipayUserCertifyOpenInitializeRequest.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_type']="IDENTITY_CARD";
|
||||||
$newsigndata['identity_param']['cert_name']=$res['name'];
|
$newsigndata['identity_param']['cert_name']=$res['name'];
|
||||||
$newsigndata['identity_param']['cert_no']= $res['id_code'];
|
$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==";
|
$newsigndata['face_contrast_picture']="xydasf==";
|
||||||
$tosign=json_encode($newsigndata);
|
$tosign=json_encode($newsigndata);
|
||||||
$request->setBizContent($tosign);
|
$request->setBizContent($tosign);
|
||||||
@@ -80,7 +77,7 @@ class Aliverify
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getResult($certify_id,$id)
|
public static function getResult($certify_id)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$aop = new \AopCertClient();
|
$aop = new \AopCertClient();
|
||||||
@@ -109,13 +106,7 @@ class Aliverify
|
|||||||
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
|
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
|
||||||
$resultCode = $result->$responseNode->passed;
|
$resultCode = $result->$responseNode->passed;
|
||||||
if($resultCode == 'T'){
|
if($resultCode == 'T'){
|
||||||
$user = new User;
|
return true;
|
||||||
$user_data['is_verify'] = 1;
|
|
||||||
if($user->updateOne(['Id'=>$id],$user_data)){
|
|
||||||
return true;
|
|
||||||
}else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,12 +60,15 @@ class Test extends Controller
|
|||||||
{
|
{
|
||||||
$user = new User;
|
$user = new User;
|
||||||
$user_one_info = $user->getOne(['Id'=>$this->userinfo['UserId']]);
|
$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 = [];
|
$data = [];
|
||||||
if($info){
|
if($info){
|
||||||
$data = [
|
$user_data['is_verify'] = 1;
|
||||||
'Code'=>10000
|
if($user->updateOne(['Id'=>$this->userinfo['UserId']],$user_data)){
|
||||||
];
|
$data = [
|
||||||
|
'Code'=>10000
|
||||||
|
];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$data = [
|
$data = [
|
||||||
'Code'=>-10000
|
'Code'=>-10000
|
||||||
|
|||||||
Reference in New Issue
Block a user