|
@@ -83,7 +83,7 @@ class Userauth extends Api
|
|
|
}
|
|
|
|
|
|
//阿里云身份证三要素认证
|
|
|
- $auth_restult = $this->userauth_aliyun_three($idcard, $truename,$this->auth->simplemobile);
|
|
|
+ $auth_restult = $this->userauth_aliyun_two($idcard, $truename,$this->auth->mobile);
|
|
|
if($auth_restult == false){
|
|
|
$this->error('身份证信息与姓名或注册手机号不符');
|
|
|
}
|
|
@@ -127,7 +127,57 @@ class Userauth extends Api
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //产品链接:https://market.aliyun.com/products/57000002/cmapi026109.html#sku=yuncode20109000025
|
|
|
+ //阿里云-数脉api
|
|
|
+ //姓名+身份证号
|
|
|
+ private function userauth_aliyun_two($cardNo = '',$realname = ''){
|
|
|
+ if(!$cardNo || !$realname){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ $config = config('aliyun_auth_shumai_two');
|
|
|
+
|
|
|
+ $host = "https://eid.shumaidata.com";
|
|
|
+ $path = "/eid/check";
|
|
|
+ $method = "POST";
|
|
|
+ $appcode = $config['app_code'];
|
|
|
+ $headers = array();
|
|
|
+ array_push($headers, "Authorization:APPCODE " . $appcode);
|
|
|
+
|
|
|
+ $querys = "idcard=".$cardNo."&name=".urlencode($realname);
|
|
|
+ $bodys = '';
|
|
|
+ $url = $host . $path . "?" . $querys;
|
|
|
+
|
|
|
+ $curl = curl_init();
|
|
|
+ curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
|
|
|
+ curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
+ curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
|
|
+ curl_setopt($curl, CURLOPT_FAILONERROR, false);
|
|
|
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
|
|
+ //设定返回信息中是否包含响应信息头,启用时会将头文件的信息作为数据流输出,true 表示输出信息头, false表示不输出信息头
|
|
|
+ //如果需要将字符串转成json,请将 CURLOPT_HEADER 设置成 false
|
|
|
+ curl_setopt($curl, CURLOPT_HEADER, false);
|
|
|
+ if (1 == strpos("$".$host, "https://"))
|
|
|
+ {
|
|
|
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
+ }
|
|
|
+ $returnRes = curl_exec($curl);
|
|
|
+ //var_dump($returnRes);
|
|
|
+ curl_close($curl);
|
|
|
+ $result = json_decode($returnRes,true);
|
|
|
+ //dump($result);
|
|
|
|
|
|
+ if(is_array($result) && isset($result['code']) && $result['code'] == 0){
|
|
|
+ if(isset($result['result']) && isset($result['result']['res'])){
|
|
|
+ if($result['result']['res'] == 1){
|
|
|
+ //实名过了
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
//产品链接:https://market.aliyun.com/products/57000002/cmapi026100.html?spm=5176.730005.result.8.1dbc123e8ArY19&innerSource=search#sku=yuncode2010000006
|
|
|
//阿里云-数脉api
|
|
|
//姓名+手机号+身份证号
|