From 18e39c5fc7363220cdd827f7e6b8c7b04abbad7e Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 25 Dec 2019 18:04:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/View/default/Home/landingPage.html | 88 ++++++++++--------- .../Controller/BaseController.class.php | 4 +- .../Controller/CommonController.class.php | 14 +-- 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Application/Home/View/default/Home/landingPage.html b/Application/Home/View/default/Home/landingPage.html index 952608179..75d609a86 100644 --- a/Application/Home/View/default/Home/landingPage.html +++ b/Application/Home/View/default/Home/landingPage.html @@ -381,7 +381,7 @@ - +
登录
@@ -423,7 +423,7 @@
获取验证码
-
修改密码
+
修改密码
@@ -462,11 +462,11 @@
获取验证码
-
立即注册
+
立即注册
注册即表示同意
- 《用户协议》 + 《用户协议》
@@ -496,11 +496,11 @@
-
立即注册
+
立即注册
注册即表示同意
- 《用户协议》 + 《用户协议》
@@ -567,42 +567,42 @@ var PhoneObj = { }, //获取验证码 sendPhoneCode:function(phone, fun){ - if(PhoneObj.codeflag){ - if(PhoneObj.checkPhone(phone)){ - //无需等待网络响应直接倒计时 - fun() - //获取验证码 - $.ajax({ - type: 'GET', - url: 'mobile.php?s=/Common/sendPhoneCode.html&phone='+phone, - dataType: 'JSON', - success: function (result) { - if (result.status != '0000') { - alert(result.msg); - } - } - }) + if(PhoneObj.codeflag){ + if(PhoneObj.checkPhone(phone)){ + //无需等待网络响应直接倒计时 + fun() + //获取验证码 + $.ajax({ + type: 'GET', + url: 'mobile.php?s=/Common/sendPhoneCode.html&phone='+phone, + dataType: 'JSON', + success: function (result) { + if (result.status != '0000') { + alert(result.msg); + } } - }else{ - // alert("发送验证码频率过高,请等待"+PhoneObj.i+"秒后再试") + }) } + }else{ + // alert("发送验证码频率过高,请等待"+PhoneObj.i+"秒后再试") + } }, checkPassword(password){ - if(password.length < 6 || password.length > 12){ - alert('密码长度6-12个字符'); - return false; - } - // var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])'); - // if (!pwdRegex.test(password)) { - // alert("您的密码复杂度太低(密码中必须包含字母、数字)!"); - // return false; - // } - var chinaRex = new RegExp("[\\u4E00-\\u9FFF]+","g");; - if (chinaRex.test(password)) { - alert("密码不允许含有中文字符!"); - return false; - } - return true; + if(password.length < 6 || password.length > 12){ + alert('密码长度6-12个字符'); + return false; + } + // var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])'); + // if (!pwdRegex.test(password)) { + // alert("您的密码复杂度太低(密码中必须包含字母、数字)!"); + // return false; + // } + var chinaRex = new RegExp("[\\u4E00-\\u9FFF]+","g");; + if (chinaRex.test(password)) { + alert("密码不允许含有中文字符!"); + return false; + } + return true; } } @@ -683,12 +683,18 @@ var PhoneObj = { window.location.href = 'mqqwpa://im/chat?chat_type=wpa&uin={$serviceQQ}&version=1&src_type=web&web_src=oicqzone.com'; }) + $('#verifyCode').on({ + click: function () { + GetVerityCode() + } + }) + function GetVerityCode() { //刷新验证码 $("#verifyCode").attr("src", "/mobile.php?s=/Common/verify.html&id=" + Math.random()); } - $("#phonereg").on("click",function(){ + $("#mobile-reg").on("click",function(){ var box = $('#phone-register-box') var phone = box.find('[name=mobile]').val() var password = box.find('[name=password]').val() @@ -774,7 +780,7 @@ var PhoneObj = { }) //普通注册 - $("#userreg").on("click", function(){ + $("#normal-reg").on("click", function(){ var box = $('#register-box') var account = box.find('[name=account]').val() var password = box.find('[name=password]').val() @@ -822,7 +828,7 @@ var PhoneObj = { }) //忘记密码 - $("#forgetBtn").on("click",function(){ + $("#modify-password").on("click",function(){ var box = $('#forget-box') var phone = box.find('[name=mobile]').val() var password = box.find('[name=password]').val() diff --git a/Application/Mobile/Controller/BaseController.class.php b/Application/Mobile/Controller/BaseController.class.php index 0b58f5446..9663c309f 100644 --- a/Application/Mobile/Controller/BaseController.class.php +++ b/Application/Mobile/Controller/BaseController.class.php @@ -385,12 +385,12 @@ class BaseController extends Controller { return M("bind_recharge","tab_")->add($data); } - protected function respondSuccess($message, $code = '0000') + protected function respondSuccess($message = '成功', $code = '0000') { $this->respond($message, $code); } - protected function respondError($message, $code = '1000') + protected function respondError($message = '失败', $code = '1000') { $this->respond($message, $code); } diff --git a/Application/Mobile/Controller/CommonController.class.php b/Application/Mobile/Controller/CommonController.class.php index ed92a328e..b67a7c7db 100644 --- a/Application/Mobile/Controller/CommonController.class.php +++ b/Application/Mobile/Controller/CommonController.class.php @@ -26,15 +26,10 @@ class CommonController extends BaseController { { $account = I('account'); $password = I('password'); - $code = I('code', ''); $verifyCode = I('verify_code', ''); - if (!$code) { - $this->respondError('参数非法'); - } + $promoteId = I('promote_id', 0); - $applyService = new ApplyService(); - $result = $applyService->decodeApplyCode($code); - if (!$result) { + if (!$promoteId) { $this->respondError('参数非法'); } @@ -42,7 +37,6 @@ class CommonController extends BaseController { if (!$verify->check($verifyCode)) { $this->respondError('验证码错误'); } - $promoteId = $result['promote_id']; $promote = M('promote', 'tab_')->where(['id' => $promoteId])->find(); $userApi = new MemberApi(); @@ -221,9 +215,9 @@ class CommonController extends BaseController { $result = R('Common/Sms/send_sms_code', [$phone, 10, false]); if ($result['code'] == 200) { - $this->setData($result['data'])->respondSuccess(); + $this->setData($result['data'])->respondSuccess('发送成功'); } else { - $this->respondError(); + $this->respondError('发送失败'); } }