Merge branch 'dev' of 47.111.118.107:/srv/git/sdk into dev

master
zhanglingsheng 5 years ago
commit 509aae47db

@ -1181,14 +1181,14 @@ function age_verify($cardno, $name)
{ {
$date = age($cardno, $name); $date = age($cardno, $name);
if ($date['resp']['code'] == 0 && $date > 0) { if ($date['status'] == '01') {
$age = floor((time() - strtotime($date['data']['birthday'])) / (60 * 60 * 24 * 365)); $age = floor((time() - strtotime($date['birthday'])) / (60 * 60 * 24 * 365));
if ($age > 17) { if ($age > 17) {
return 1; return 1;
} else { } else {
return 2; return 2;
} }
} elseif ($date['resp']['code'] != 0 && $date > 0) { } elseif ($date['status'] != '01') {
return 0; return 0;
} else { } else {
return $date; return $date;
@ -1198,39 +1198,65 @@ function age_verify($cardno, $name)
//根据配置向接口发送身份证号和姓名进行验证 //根据配置向接口发送身份证号和姓名进行验证
function age($cardno, $name) function age($cardno, $name)
{ {
$host = "http://idcard.market.alicloudapi.com"; $host = "https://idcardcert.market.alicloudapi.com";
$path = "/lianzhuo/idcard"; $path = "/idCardCert";
$method = "GET"; $method = "GET";
$appcode = C('tool_age.appcode'); $appcode = "244181f0846541a19e24df409736d3b9";
$headers = array(); $headers = array();
array_push($headers, "Authorization:APPCODE " . $appcode); array_push($headers, "Authorization:APPCODE " . $appcode);
$querys = "cardno=" . $cardno . "&name=" . $name; $querys = "idCard={$cardno}&name={$name}";
$bodys = ""; $bodys = "";
$url = $host . $path . "?" . $querys; $url = $host . $path . "?" . $querys;
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); $curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $host, "https://")) { curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //curl_setopt($curl, CURLOPT_HEADER, true); 如不输出json, 请打开这行代码,打印调试头部状态码。
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); //状态码: 200 正常400 URL无效401 appCode错误 403 次数用完; 500 API网管错误
} if (1 == strpos("$".$host, "https://"))
$output = curl_exec($curl); {
if (empty($output)) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
return -1;//用完 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
} }
if (curl_getinfo($curl, CURLINFO_HTTP_CODE) == '200') { $output = curl_exec($curl);
$headersize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); if (empty($output)) {
$header = substr($output, 0, $headersize); return -1;//用完
$body = substr($output, $headersize); }
curl_close($curl);
return json_decode($body, true); $r = json_decode($output, true);
} else { if ($r['status'] == "02") return 0;
return -2;//失败
} return $r;
}
function age2($cardno, $name) {
$host = "https://idcardcert.market.alicloudapi.com";
$path = "/idCardCert";
$method = "GET";
$appcode = '244181f0846541a19e24df409736d3b9';//C('tool_age.appcode');
$headers = array();
array_push($headers, "Authorization:APPCODE " . $appcode);
$querys = "idCard={$cardno}&name={$name}";
$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);
curl_setopt($curl, CURLOPT_HEADER, true);
if (1 == strpos("$".$host, "https://"))
{
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
var_dump(curl_exec($curl));
} }
/*短信发送验证限制条件 */ /*短信发送验证限制条件 */

@ -836,7 +836,7 @@ class UserController extends BaseController
$this -> set_message(1027, "fail", "账号为6-15位字母或数字"); $this -> set_message(1027, "fail", "账号为6-15位字母或数字");
} }
if(!preg_match('/^[0-9a-zA-Z]{6,15}$/', $user['password'])){ if(!preg_match('/^[0-9a-zA-Z]{6,15}$/', $user['password'])){
$this -> set_message(1027, "fail", "密码为6-12位字母数字"); $this -> set_message(1027, "fail", "密码为6-15位字母数字");
} }
/* if(!preg_match('/^(?![^a-zA-Z]+$)(?!\D+$).{6,15}$/', $user['password'])){ /* if(!preg_match('/^(?![^a-zA-Z]+$)(?!\D+$).{6,15}$/', $user['password'])){
@ -851,7 +851,7 @@ class UserController extends BaseController
} else {//用户1 } else {//用户1
if(!preg_match('/^(?![^a-zA-Z]+$)(?!\D+$).{6,15}$/', $user['account'])){ if(!preg_match('/^(?![^a-zA-Z]+$)(?!\D+$).{6,15}$/', $user['account'])){
$this -> set_message(1027, "fail", "账号为6-12位字母或数字"); $this -> set_message(1027, "fail", "账号为6-15位字母或数字");
} }
$result = $userApi -> sdk_register_($user['account'], $user['password'], 1, 1, $user['promote_id'], get_promote_name($user['promote_id']), $phone = "", $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version'] ,$user['device_type'],$user['unique_code']); $result = $userApi -> sdk_register_($user['account'], $user['password'], 1, 1, $user['promote_id'], get_promote_name($user['promote_id']), $phone = "", $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version'] ,$user['device_type'],$user['unique_code']);
} }
@ -952,7 +952,7 @@ class UserController extends BaseController
$this -> new_set_message(1027, "密码必须6-15位字母和数字组合"); $this -> new_set_message(1027, "密码必须6-15位字母和数字组合");
} */ } */
if(!preg_match('/^[0-9a-zA-Z]{6,15}$/', $user['password'])){ if(!preg_match('/^[0-9a-zA-Z]{6,15}$/', $user['password'])){
$this -> set_message(1027, "fail", "6-15位字母或数字"); $this -> set_message(1027, "fail", "密码6-15位字母或数字");
} }
if ($user['old_password'] == $user['password']) { if ($user['old_password'] == $user['password']) {
@ -2133,6 +2133,7 @@ class UserController extends BaseController
case 2://未成年 case 2://未成年
$data['age_status'] = 3; $data['age_status'] = 3;
break; break;
default: default:
} }

@ -328,7 +328,7 @@ class WapPayController extends BaseController{
if ($orderPrice != $payInfo['price']) { if ($orderPrice != $payInfo['price']) {
$this->error($orderPrice."数据有误.".$payInfo['price'], '', true); $this->error($orderPrice."数据有误.".$payInfo['price'], '', true);
} }
if ($payInfo['type'] == 'sq_shortcut_platform' && $payInfo['price'] <= 1) { if ($payInfo['type'] == 'sq_shortcut_platform' && $payInfo['price'] < 1) {
$this->error("数据有误", '', true); $this->error("数据有误", '', true);
} }
if ($payInfo['status'] == 'payed') { if ($payInfo['status'] == 'payed') {

@ -154,9 +154,12 @@ $(function() {
$("#paytype").html("支付成功"); $("#paytype").html("支付成功");
if (!isAndroid) { if (!isAndroid) {
try { try {
// window.location.href = Scheme+"://1";
window.webkit.messageHandlers.exchangeResult.postMessage(1); window.webkit.messageHandlers.exchangeResult.postMessage(1);
window.location.href = r.url;
} catch(err) { } catch(err) {
window.location.href = Scheme+"://1"; window.location.href = Scheme+"://1";
// window.location.href = Scheme+"://1";
} }
} }
} else { } else {
@ -165,15 +168,19 @@ $(function() {
if (!isAndroid) { if (!isAndroid) {
try { try {
window.webkit.messageHandlers.exchangeResult.postMessage(0); window.webkit.messageHandlers.exchangeResult.postMessage(0);
window.location.href = r.url;
} catch(err) { } catch(err) {
window.location.href = Scheme+"://0"; window.location.href = Scheme+"://0";
} }
} }
} }
$("#toast").show();
setTimeout(function(){ if (isAndroid) {
window.location.href = r.url; $("#toast").show();
},2000) setTimeout(function(){
window.location.href = r.url;
},2000)
}
} }
if (r.type == "spend") { if (r.type == "spend") {

Loading…
Cancel
Save