Commit bbad47d2 authored by liuqiao's avatar liuqiao

弱密码

parent 9297de44
......@@ -389,70 +389,70 @@ var _hmt = _hmt || [];
$('.qrcode_login').hide();
$('.forms').show();
})
// $.ajax({
// url: '/login/qrCode',
// type: 'get',
// dataType: 'json',
// sync: true,
// success: function (response) {
// console.log(response);
// if (response.result === '0') {
// layer.msg(response.msg);
// }
// $("#qrcode_img").attr('src',response.login_img);
// var uuid = response.key;
// var qrcodeLogin = setInterval(function (){
// $.ajax({
// url: '/login/qrCodeLogin',
// type: 'post',
// dataType: 'json',
// data: {uuid:uuid},
// sync: true,
// success: function (response) {
// console.log(response);
// var msg = response.msg;
//
// if (msg === 'expired') {
// clearInterval(qrcodeLogin);
// layer.msg('登录失败,请刷新二维码重新登录');
// return;
// }
//
// if (msg === 'wait') {
// return;
// }
//
// if (msg === 'success' || msg === 'has_login') {
// clearInterval(qrcodeLogin);
// layer.msg('登录成功',{
// icon: 1,
// time: 2000
// },function (){
// location.href = "/";
// })
// } else {
// var errorMsg = '';
// switch(msg) {
// case 'u_p_error':
// errorMsg = '账号不正确,请刷新二维码重新扫描';
// break;
// case 'vad_error':
// case 'exp_error':
// errorMsg = '该账号已到期,请联系网站工作人员!';
// break;
// default:
// errorMsg = '登陆失败,请稍后再试!';
// break;
// }
// clearInterval(qrcodeLogin);
// layer.msg(errorMsg);
// }
//
// }
// })
// },1000 * 10)
// }
// })
$.ajax({
url: '/login/qrCode',
type: 'get',
dataType: 'json',
sync: true,
success: function (response) {
console.log(response);
if (response.result === '0') {
layer.msg(response.msg);
}
$("#qrcode_img").attr('src',response.login_img);
var uuid = response.key;
var qrcodeLogin = setInterval(function (){
$.ajax({
url: '/login/qrCodeLogin',
type: 'post',
dataType: 'json',
data: {uuid:uuid},
sync: true,
success: function (response) {
console.log(response);
var msg = response.msg;
if (msg === 'expired') {
clearInterval(qrcodeLogin);
layer.msg('登录失败,请刷新二维码重新登录');
return;
}
if (msg === 'wait') {
return;
}
if (msg === 'success' || msg === 'has_login') {
clearInterval(qrcodeLogin);
layer.msg('登录成功',{
icon: 1,
time: 2000
},function (){
location.href = "/";
})
} else {
var errorMsg = '';
switch(msg) {
case 'u_p_error':
errorMsg = '账号不正确,请刷新二维码重新扫描';
break;
case 'vad_error':
case 'exp_error':
errorMsg = '该账号已到期,请联系网站工作人员!';
break;
default:
errorMsg = '登陆失败,请稍后再试!';
break;
}
clearInterval(qrcodeLogin);
layer.msg(errorMsg);
}
}
})
},1000 * 10)
}
})
})
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment