From d1ac6610d3bf079655e58001e31116423c9eafe2 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 19 Nov 2019 19:42:10 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/View/default/Spend/paycallback.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Application/Sdk/View/default/Spend/paycallback.html b/Application/Sdk/View/default/Spend/paycallback.html index 7c6e295f..2235ecb7 100644 --- a/Application/Sdk/View/default/Spend/paycallback.html +++ b/Application/Sdk/View/default/Spend/paycallback.html @@ -170,10 +170,13 @@ $(function() { } } } - $("#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") { From 1a056ee9025017fb5cae00a54d7fe99c37cfb1a4 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 19 Nov 2019 19:47:12 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/View/default/Spend/paycallback.html | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Application/Sdk/View/default/Spend/paycallback.html b/Application/Sdk/View/default/Spend/paycallback.html index 2235ecb7..11bf95e6 100644 --- a/Application/Sdk/View/default/Spend/paycallback.html +++ b/Application/Sdk/View/default/Spend/paycallback.html @@ -154,9 +154,14 @@ $(function() { $("#paytype").html("支付成功"); if (!isAndroid) { try { - window.webkit.messageHandlers.exchangeResult.postMessage(1); + window.location.href = Scheme+"://1"; + // window.webkit.messageHandlers.exchangeResult.postMessage(1); } catch(err) { - window.location.href = Scheme+"://1"; + // window.location.href = Scheme+"://1"; + $("#toast").show(); + setTimeout(function(){ + window.location.href = r.url; + },2000) } } } else { @@ -164,9 +169,14 @@ $(function() { $("#paytype").html("支付失败"); if (!isAndroid) { try { - window.webkit.messageHandlers.exchangeResult.postMessage(0); + window.location.href = Scheme+"://0"; + // window.webkit.messageHandlers.exchangeResult.postMessage(0); } catch(err) { - window.location.href = Scheme+"://0"; + $("#toast").show(); + setTimeout(function(){ + window.location.href = r.url; + },2000) + //window.location.href = Scheme+"://0"; } } } From f1ca4348d0b9783d094e7d7cb54b151e37992bfb Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 19 Nov 2019 20:03:54 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/View/default/Spend/paycallback.html | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Application/Sdk/View/default/Spend/paycallback.html b/Application/Sdk/View/default/Spend/paycallback.html index 11bf95e6..aa617095 100644 --- a/Application/Sdk/View/default/Spend/paycallback.html +++ b/Application/Sdk/View/default/Spend/paycallback.html @@ -154,14 +154,12 @@ $(function() { $("#paytype").html("支付成功"); if (!isAndroid) { try { - window.location.href = Scheme+"://1"; - // window.webkit.messageHandlers.exchangeResult.postMessage(1); + // 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"; - $("#toast").show(); - setTimeout(function(){ - window.location.href = r.url; - },2000) } } } else { @@ -169,14 +167,10 @@ $(function() { $("#paytype").html("支付失败"); if (!isAndroid) { try { - window.location.href = Scheme+"://0"; - // window.webkit.messageHandlers.exchangeResult.postMessage(0); + window.webkit.messageHandlers.exchangeResult.postMessage(0); + window.location.href = r.url; } catch(err) { - $("#toast").show(); - setTimeout(function(){ - window.location.href = r.url; - },2000) - //window.location.href = Scheme+"://0"; + window.location.href = Scheme+"://0"; } } } From 161dc7419e06316d9173782c9532f9f954fce574 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 19 Nov 2019 20:07:06 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=20=20=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Controller/WapPayController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Sdk/Controller/WapPayController.class.php b/Application/Sdk/Controller/WapPayController.class.php index 87665bbd..53a9ba59 100644 --- a/Application/Sdk/Controller/WapPayController.class.php +++ b/Application/Sdk/Controller/WapPayController.class.php @@ -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') { From 831b7d5ba258d45f7e18d7b415a84b09dfffcec0 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 19 Nov 2019 20:11:31 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/function.php | 79 +++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index c8728473..d6d0aeab 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -1198,16 +1198,65 @@ function age_verify($cardno, $name) //根据配置向接口发送身份证号和姓名进行验证 function age($cardno, $name) { - $host = "http://idcard.market.alicloudapi.com"; - $path = "/lianzhuo/idcard"; + $host = "https://idcardcert.market.alicloudapi.com"; + $path = "/idCardCert"; + $method = "GET"; + $appcode = "244181f0846541a19e24df409736d3b9"; + $headers = array(); + array_push($headers, "Authorization:APPCODE " . $appcode); + $querys = "idCard=510703198602170052&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;//用完 + } + + echo $output; + + die; + + 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;//失败 + } + + echo $output; + + die; + $host = "https://idcardcert.market.alicloudapi.com"; + $path = "/idCardCert"; $method = "GET"; $appcode = C('tool_age.appcode'); $headers = array(); + $appcode = '244181f0846541a19e24df409736d3b9'; array_push($headers, "Authorization:APPCODE " . $appcode); $querys = "cardno=" . $cardno . "&name=" . $name; $bodys = ""; $url = $host . $path . "?" . $querys; $curl = curl_init(); +// var_dump($headers); +// pp($url); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); @@ -1233,6 +1282,32 @@ function age($cardno, $name) } } +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)); +} + /*短信发送验证限制条件 */ function checksendcode($phone, $limit) { From db975f1fdc562c12a6cf558cffe67b16b09e7c54 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 19 Nov 2019 20:20:08 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/function.php | 61 ++----------------- .../Sdk/Controller/UserController.class.php | 7 ++- 2 files changed, 10 insertions(+), 58 deletions(-) diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index d6d0aeab..87921429 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -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; @@ -1227,59 +1227,10 @@ function age($cardno, $name) return -1;//用完 } - echo $output; + $r = json_decode($output, true); + if ($r['status'] == "02") return 0; - die; - - 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;//失败 - } - - echo $output; - - die; - $host = "https://idcardcert.market.alicloudapi.com"; - $path = "/idCardCert"; - $method = "GET"; - $appcode = C('tool_age.appcode'); - $headers = array(); - $appcode = '244181f0846541a19e24df409736d3b9'; - array_push($headers, "Authorization:APPCODE " . $appcode); - $querys = "cardno=" . $cardno . "&name=" . $name; - $bodys = ""; - $url = $host . $path . "?" . $querys; - $curl = curl_init(); -// var_dump($headers); -// pp($url); - 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;//失败 - } + return $r; } function age2($cardno, $name) { diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index 7d07d8ed..8414ce87 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -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: } From ac67cc786ce1d8a96ebd19eb758f00e672494d69 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 19 Nov 2019 20:22:14 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/function.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index 87921429..6c5ccfb8 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -1204,7 +1204,7 @@ function age($cardno, $name) $appcode = "244181f0846541a19e24df409736d3b9"; $headers = array(); array_push($headers, "Authorization:APPCODE " . $appcode); - $querys = "idCard=510703198602170052&name=伍帅"; + $querys = "idCard={$cardno}&name={$name}"; $bodys = ""; $url = $host . $path . "?" . $querys;