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);
if ($date['resp']['code'] == 0 && $date > 0) {
$age = floor((time() - strtotime($date['data']['birthday'])) / (60 * 60 * 24 * 365));
if ($date['status'] == '01') {
$age = floor((time() - strtotime($date['birthday'])) / (60 * 60 * 24 * 365));
if ($age > 17) {
return 1;
} else {
return 2;
}
} elseif ($date['resp']['code'] != 0 && $date > 0) {
} elseif ($date['status'] != '01') {
return 0;
} else {
return $date;
@ -1198,39 +1198,65 @@ function age_verify($cardno, $name)
//根据配置向接口发送身份证号和姓名进行验证
function age($cardno, $name)
{
$host = "http://idcard.market.alicloudapi.com";
$path = "/lianzhuo/idcard";
$method = "GET";
$appcode = C('tool_age.appcode');
$headers = array();
array_push($headers, "Authorization:APPCODE " . $appcode);
$querys = "cardno=" . $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);
}
$output = curl_exec($curl);
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;//失败
}
$host = "https://idcardcert.market.alicloudapi.com";
$path = "/idCardCert";
$method = "GET";
$appcode = "244181f0846541a19e24df409736d3b9";
$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, false);
//curl_setopt($curl, CURLOPT_HEADER, true); 如不输出json, 请打开这行代码,打印调试头部状态码。
//状态码: 200 正常400 URL无效401 appCode错误 403 次数用完; 500 API网管错误
if (1 == strpos("$".$host, "https://"))
{
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$output = curl_exec($curl);
if (empty($output)) {
return -1;//用完
}
$r = json_decode($output, true);
if ($r['status'] == "02") return 0;
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位字母或数字");
}
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'])){
@ -851,7 +851,7 @@ class UserController extends BaseController
} else {//用户1
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']);
}
@ -952,7 +952,7 @@ class UserController extends BaseController
$this -> new_set_message(1027, "密码必须6-15位字母和数字组合");
} */
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']) {
@ -2133,6 +2133,7 @@ class UserController extends BaseController
case 2://未成年
$data['age_status'] = 3;
break;
default:
}

@ -328,7 +328,7 @@ class WapPayController extends BaseController{
if ($orderPrice != $payInfo['price']) {
$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);
}
if ($payInfo['status'] == 'payed') {

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

Loading…
Cancel
Save