diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index 20b2b63ac..61fab3954 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -1197,7 +1197,7 @@ function age_verify($cardno, $name) } else { return 2; } - } elseif ($date['status'] > 200) { + } elseif (isset($date['status']) && $date['status'] != '01') { return -2; } else { return $date; @@ -1210,11 +1210,11 @@ function age($cardno, $name) $host = "https://idcardcert.market.alicloudapi.com"; $path = "/idCardCert"; $method = "GET"; - $appcode = C('tool_age.appcode'); - // $appcode = "244181f0846541a19e24df409736d3b9"; + // $appcode = C('tool_age.appcode'); + $appcode = "244181f0846541a19e24df409736d3b9"; $headers = array(); array_push($headers, "Authorization:APPCODE " . $appcode); - $querys = "idCard=" . $cardno . "&name=" . $name; + $querys ="idCard={$cardno}&name={$name}"; $bodys = ""; $url = $host . $path . "?" . $querys; $curl = curl_init(); @@ -1223,7 +1223,7 @@ function age($cardno, $name) curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_HEADER, true); + 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); @@ -1236,18 +1236,7 @@ function age($cardno, $name) $r = json_decode($output, true); if ($r['status'] == "02") return 0; 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;//失败 - // } + } /*短信发送验证限制条件 */ diff --git a/Application/Mobile/Controller/UserController.class.php b/Application/Mobile/Controller/UserController.class.php index b1bc61ffb..138b72c15 100644 --- a/Application/Mobile/Controller/UserController.class.php +++ b/Application/Mobile/Controller/UserController.class.php @@ -1039,9 +1039,9 @@ class UserController extends BaseController $resdata = 3;//未成年 } } - // if ($re > 0) { - $model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata)); - // } + if ($re > 0) { + $model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata)); + } if ($model !== false) {