优化bug

master
chenzhi 5 years ago
parent 8af781b9b4
commit a54a6b8b26

@ -61,8 +61,9 @@ class SsgController extends BaseController {
public function do_login() public function do_login()
{ {
$account = I("Account"); $account = I("Account");
$password = I("Password"); $password = I("Password");
$promoteId = I("promote_id", 0); $promoteId = I("promote_id", 0);
$password = base64_decode($password);
/*if (!$promoteId) { /*if (!$promoteId) {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "参数非法")); $this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "参数非法"));
}*/ }*/

@ -97,7 +97,7 @@
</div> </div>
<div class="formitem"> <div class="formitem">
<img src="__IMG__/ssg/login/password.png"> <img src="__IMG__/ssg/login/password.png">
<input id="phonepassword" type="password" placeholder="请输入6-12位字母组合密码" value=""> <input id="phonepassword" type="password" placeholder="请输入6-12位字母组合密码" value="">
</div> </div>
<div class="formitem" style="border: 0px;"> <div class="formitem" style="border: 0px;">
<div class="formitem" style="margin-right: .2rem;margin-top: 0px;width: 3.5rem;"> <div class="formitem" style="margin-right: .2rem;margin-top: 0px;width: 3.5rem;">
@ -212,6 +212,7 @@
</body> </body>
<script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script> <script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="__JS__/swiper.min.js" type="text/javascript"></script> <script src="__JS__/swiper.min.js" type="text/javascript"></script>
<script src="__JS__/ssg/base64.min.js" type="text/javascript"></script>
<script> <script>
var PhoneObj = { var PhoneObj = {
i:60, i:60,
@ -257,15 +258,30 @@ var PhoneObj = {
if (result.status != 1) { if (result.status != 1) {
alert(result.msg); alert(result.msg);
} }
// else {
// fun()
// }
} }
}) })
} }
}else{ }else{
// alert("发送验证码频率过高,请等待"+PhoneObj.i+"秒后再试") // alert("发送验证码频率过高,请等待"+PhoneObj.i+"秒后再试")
} }
},
checkPassword(password){
console.log(password);
if(password.length < 6 || password.length > 15){
alert('密码长度6-15个字符');
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;
} }
} }
@ -333,7 +349,7 @@ var PhoneObj = {
url: 'mobile.php?s=/Ssg/do_login.html', url: 'mobile.php?s=/Ssg/do_login.html',
data: { data: {
'Account': loginName, 'Account': loginName,
'Password': (loginPass), 'Password': window.btoa(loginPass),
'VerifyCode': userCode, 'VerifyCode': userCode,
'promote_id': promoteId, 'promote_id': promoteId,
}, },
@ -362,17 +378,9 @@ var PhoneObj = {
if(!PhoneObj.checkPhone(phone)){ if(!PhoneObj.checkPhone(phone)){
return false; return false;
} }
if(phonepassword.length < 6 || phonepassword.length > 15){ if(!PhoneObj.checkPassword(phonepassword)){
alert('密码长度6-15个字符');
return false; return false;
} }
var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])');
if (!pwdRegex.test(phonepassword)) {
alert("您的密码复杂度太低(密码中必须包含字母、数字)!");
return false;
}
if(phonecode == ''){ if(phonecode == ''){
alert('请输入验证码'); alert('请输入验证码');
return false; return false;
@ -435,13 +443,7 @@ var PhoneObj = {
alert("账号必须是6-12位字母数字组合"); alert("账号必须是6-12位字母数字组合");
return false; return false;
} }
if(regpassword.length < 6 || regpassword.length > 15){ if(!PhoneObj.checkPassword(regpassword)){
alert('密码长度6-15个字符');
return false;
}
if (!pwdRegex.test(regpassword)) {
alert("您的密码复杂度太低(密码中必须包含字母、数字)!");
return false; return false;
} }
if(regpassword != regpassword2){ if(regpassword != regpassword2){
@ -480,14 +482,7 @@ var PhoneObj = {
if(!PhoneObj.checkPhone(phone)){ if(!PhoneObj.checkPhone(phone)){
return false; return false;
} }
if(phonepassword.length < 6 || phonepassword.length > 15){ if(!PhoneObj.checkPassword(phonepassword)){
alert('密码长度6-15个字符');
return false;
}
var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])');
if (!pwdRegex.test(phonepassword)) {
alert("您的密码复杂度太低(密码中必须包含字母、数字)!");
return false; return false;
} }
if(phonecode == ''){ if(phonecode == ''){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 KiB

After

Width:  |  Height:  |  Size: 735 KiB

@ -0,0 +1 @@
!function(){var e="object"==typeof exports&&null!==exports&&"number"!=typeof exports.nodeType?exports:"undefined"!=typeof self?self:$.global,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function f(e){this.message=e}(f.prototype=new Error).name="InvalidCharacterError",e.btoa||(e.btoa=function(e){for(var t,r,o=String(e),n=0,a=c,i="";o.charAt(0|n)||(a="=",n%1);i+=a.charAt(63&t>>8-n%1*8)){if(255<(r=o.charCodeAt(n+=.75)))throw new f("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");t=t<<8|r}return i}),e.atob||(e.atob=function(e){var t=String(e).replace(/[=]+$/,"");if(t.length%4==1)throw new f("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,n=0,a=0,i="";o=t.charAt(a++);~o&&(r=n%4?64*r+o:o,n++%4)?i+=String.fromCharCode(255&r>>(-2*n&6)):0)o=c.indexOf(o);return i})}();
Loading…
Cancel
Save