验证码简化

master
chenzhi 5 years ago
parent ca79a3f627
commit 992ef831b5

@ -77,6 +77,7 @@ class SsgController extends BaseController {
if (!$verify->check(I("VerifyCode"))) {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "验证码错误"));
}
$userApi = new MemberApi();
$user_id = $userApi->login($account, $password,1);//调用登录
$res_code = 0;
@ -124,6 +125,8 @@ class SsgController extends BaseController {
'imageW' => 107, // 验证码图片宽度
'length' => 4, // 验证码位数
'fontttf' => '4.ttf', // 验证码字体,不设置随机获取
'useCurve' => false, // 是否画混淆曲线
'useNoise' => false, // 是否添加杂点
'useCurve' => false,
);

@ -41,6 +41,7 @@
<img src="__IMG__/ssg/login/code.png">
<input id="userCode" type="text" placeholder="请输入验证码" value="">
</div>
<!-- <div id="verifyCode" class="verify-code" onclick="GetVerityCode()" style="color:green;width: 1.5rem;height: .7rem;line-height: .7rem;text-align:center;font-size: .40rem;border:1px solid green;letter-spacing:3px;"></div> -->
<img class="verify-img" id="verifyCode" onclick="GetVerityCode()" src="/mobile.php?s=/Ssg/verify.html">
</div>
<!---按钮-->
@ -156,12 +157,11 @@
// initialSlide :2,
noSwiping : true,
})
var loginLock = false;
function GetVerityCode() {
//刷新验证码
$("#verifyCode").attr("src", "/mobile.php?s=/Ssg/verify.html&id=" + Math.random());
}
}
$(".gophonreg").on("click",function() {
//去手机注册页
mySwiper.slideTo(1, 350, false);
@ -180,7 +180,8 @@
$(".chatqq").on("click",function(){
window.location.href = 'mqqwpa://im/chat?chat_type=wpa&uin={$app_qq}&version=1&src_type=web&web_src=oicqzone.com';
})
//获取登录密码
//获取验证码
//登陆
$("#loginbtn").on("click",function(){
@ -204,7 +205,10 @@
alert("推广员ID不能为空");
return false;
}
if(userCode != verifyCode){
alert("验证码错误,请重新输入");
return false;
}
jQuery.ajax({
type: 'POST',
url: 'mobile.php?s=/Ssg/do_login.html',

@ -465,6 +465,9 @@ font-size: .16rem;
.login-page .loginbox .verify-item .verify-img{
cursor:pointer;width:1.5rem;height: .7rem;margin-right:0px;
}
/* .login-page .loginbox .verify-item .verify-img{
cursor:pointer;width:1.5rem;height: .7rem;margin-right:0px;
} */
.login-page .loginbox .login-btn-group{
display: flex;width:100%;margin:.22rem auto 0;justify-content:center;align-items:center;font-size: .32rem;text-align: center;line-height:1.1rem;color: #fff;
}

Loading…
Cancel
Save