实名6.0

master
chenzhi 5 years ago
parent 02e527d15b
commit 6368693b48

@ -1197,7 +1197,7 @@ function age_verify($cardno, $name)
} else { } else {
return 2; return 2;
} }
} elseif ($date['status'] > 200) { } elseif (isset($date['status']) && $date['status'] != '01') {
return -2; return -2;
} else { } else {
return $date; return $date;
@ -1210,11 +1210,11 @@ function age($cardno, $name)
$host = "https://idcardcert.market.alicloudapi.com"; $host = "https://idcardcert.market.alicloudapi.com";
$path = "/idCardCert"; $path = "/idCardCert";
$method = "GET"; $method = "GET";
$appcode = C('tool_age.appcode'); // $appcode = C('tool_age.appcode');
// $appcode = "244181f0846541a19e24df409736d3b9"; $appcode = "244181f0846541a19e24df409736d3b9";
$headers = array(); $headers = array();
array_push($headers, "Authorization:APPCODE " . $appcode); array_push($headers, "Authorization:APPCODE " . $appcode);
$querys = "idCard=" . $cardno . "&name=" . $name; $querys ="idCard={$cardno}&name={$name}";
$bodys = ""; $bodys = "";
$url = $host . $path . "?" . $querys; $url = $host . $path . "?" . $querys;
$curl = curl_init(); $curl = curl_init();
@ -1223,7 +1223,7 @@ function age($cardno, $name)
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_HEADER, false);
if (1 == strpos("$" . $host, "https://")) { if (1 == strpos("$" . $host, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
@ -1236,18 +1236,7 @@ function age($cardno, $name)
$r = json_decode($output, true); $r = json_decode($output, true);
if ($r['status'] == "02") return 0; if ($r['status'] == "02") return 0;
return $r; return $r;
// if (empty($output)) {
// return -1;//用完
// }
// if (curl_getinfo($curl, CURLINFO_HTTP_CODE) == '200') {
// $headersize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
// $header = substr($output, 0, $headersize);
// $body = substr($output, $headersize);
// curl_close($curl);
// return json_decode($body, true);
// } else {
// return -2;//失败
// }
} }
/*短信发送验证限制条件 */ /*短信发送验证限制条件 */

@ -1039,9 +1039,9 @@ class UserController extends BaseController
$resdata = 3;//未成年 $resdata = 3;//未成年
} }
} }
// if ($re > 0) { if ($re > 0) {
$model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata)); $model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata));
// } }
if ($model !== false) { if ($model !== false) {

Loading…
Cancel
Save