|
@@ -21,6 +21,9 @@
|
|
</div>
|
|
</div>
|
|
<div class="split-block"></div>
|
|
<div class="split-block"></div>
|
|
<form method="post" id="form_account" action="{{route($sub_site.'mobile.login')}}">
|
|
<form method="post" id="form_account" action="{{route($sub_site.'mobile.login')}}">
|
|
|
|
+ <input type="hidden" name="ticket" id="ticket">
|
|
|
|
+ <input type="hidden" name="bizState" id="bizState">
|
|
|
|
+ <input type="hidden" name="randstr" id="randstr">
|
|
{{ csrf_field() }}
|
|
{{ csrf_field() }}
|
|
<div class="loging-input-group">
|
|
<div class="loging-input-group">
|
|
<div class="group-list">
|
|
<div class="group-list">
|
|
@@ -119,7 +122,7 @@
|
|
$(".register_user").click(function(){
|
|
$(".register_user").click(function(){
|
|
var url=$(this).attr("url")
|
|
var url=$(this).attr("url")
|
|
$.getJSON("{{route($sub_site.'register.status')}}", function (result) {
|
|
$.getJSON("{{route($sub_site.'register.status')}}", function (result) {
|
|
-
|
|
|
|
|
|
+
|
|
if (result.status == 0) {
|
|
if (result.status == 0) {
|
|
qsToast({type:2,context: result.msg});
|
|
qsToast({type:2,context: result.msg});
|
|
} else{
|
|
} else{
|
|
@@ -140,7 +143,43 @@
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
- gt_init(gt_call_back);//初始化极验
|
|
|
|
|
|
+ //gt_init(gt_call_back);//初始化极验
|
|
|
|
+
|
|
|
|
+ var captcha_callback = function(res){
|
|
|
|
+ if(res.hasOwnProperty('errorMessage')){
|
|
|
|
+ alert(res.errorMessage)
|
|
|
|
+ }
|
|
|
|
+ if(res.ret == 0){
|
|
|
|
+ console.log('行为验证通过');
|
|
|
|
+
|
|
|
|
+ $("#ticket").val(res.ticket);
|
|
|
|
+ $("#bizState").val(res.bizState);
|
|
|
|
+ $("#randstr").val(res.randstr);
|
|
|
|
+ ajax_login(1);
|
|
|
|
+ }else{
|
|
|
|
+ console.log('用户主动关闭验证码')
|
|
|
|
+ }
|
|
|
|
+ console.log('callback:', res);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ var captcha = new TencentCaptcha('196587903', captcha_callback, {});
|
|
|
|
+ $('.login-account').on('click', function () {
|
|
|
|
+ var usernameValue = $.trim($('input[name=account]').val());
|
|
|
|
+ var passwordValue = $.trim($('input[name=password]').val());
|
|
|
|
+ if (usernameValue == '') {
|
|
|
|
+ qsToast({type:2,context: '请输入用户名/手机号'});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (passwordValue == '') {
|
|
|
|
+ qsToast({type:2,context: '请输入密码'});
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ajax_login(1);
|
|
|
|
+
|
|
|
|
+ captcha.show();
|
|
|
|
+ });
|
|
|
|
|
|
$(".input-login").keydown(function(ev){
|
|
$(".input-login").keydown(function(ev){
|
|
ev = ev || window.event;
|
|
ev = ev || window.event;
|
|
@@ -222,9 +261,7 @@
|
|
error: function (errorData) {
|
|
error: function (errorData) {
|
|
//console.log(errorData);
|
|
//console.log(errorData);
|
|
var response=$.parseJSON(errorData.response);
|
|
var response=$.parseJSON(errorData.response);
|
|
- if (is_need_geetest==1){
|
|
|
|
- captchaObj.reset();
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
if (errorData.status==422) {//验证错误
|
|
if (errorData.status==422) {//验证错误
|
|
$.each(response.errors,function (key,val) {
|
|
$.each(response.errors,function (key,val) {
|
|
qsToast({type:2,context: val[0]});
|
|
qsToast({type:2,context: val[0]});
|
|
@@ -233,7 +270,7 @@
|
|
}
|
|
}
|
|
else if(errorData.status==400) {//业务错误
|
|
else if(errorData.status==400) {//业务错误
|
|
qsToast({type:2,context: response.message});
|
|
qsToast({type:2,context: response.message});
|
|
- is_need_geetest=response.errors.is_need_geetest;
|
|
|
|
|
|
+ //is_need_geetest=response.errors.is_need_geetest;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|