|
@@ -5,6 +5,9 @@
|
|
|
<div class="form-l">
|
|
|
<div class="user-login">
|
|
|
<form id="form_company" action="{{route('login.company')}}" method="post">
|
|
|
+ <input type="hidden" name="ticket" id="ticket">
|
|
|
+ <input type="hidden" name="bizState" id="bizState">
|
|
|
+ <input type="hidden" name="randstr" id="randstr">
|
|
|
{{ csrf_field() }}
|
|
|
<div id="company_account"></div>
|
|
|
<div id="message_company"></div>
|
|
@@ -51,41 +54,64 @@
|
|
|
|
|
|
<script type="text/javascript" src="{{ theme_asset('gt/gt.js') }}"></script>
|
|
|
<script type="text/javascript" src="{{ theme_asset('gt/gt.handle.js') }}"></script>
|
|
|
+<script src="https://captcha.253.com/TCaptcha.js"></script>
|
|
|
@include('module.widgets.thirdlogin', ['redirect_url'=>$redirect_url])
|
|
|
|
|
|
{{--@section('script')--}}
|
|
|
<script>
|
|
|
- $(function () {
|
|
|
- var is_need_geetest=0;//全局,是否使用极验.
|
|
|
- var login_type=1;//登录模式,1用户账号登录,2用户手机登录,3企业登录.
|
|
|
- var gt_call_back=function(captchaObj) {
|
|
|
- captchaObj.onReady(function () {
|
|
|
- //极验加载完成
|
|
|
- });
|
|
|
- captchaObj.onSuccess(function () {
|
|
|
- ajax_login(login_type,captchaObj);
|
|
|
- });
|
|
|
- captchaObj.onError(function () {
|
|
|
- show_error(login_type,"请先进行验证");
|
|
|
- });
|
|
|
- captchaObj.onClose(function () {
|
|
|
- show_error(login_type,"请先进行验证");
|
|
|
- });
|
|
|
- $(document).on('click','.login-company', function () {
|
|
|
- login_type=3;
|
|
|
- clean_message();
|
|
|
- if (is_need_geetest==1){
|
|
|
- captchaObj.bindForm("#form_company");
|
|
|
- captchaObj.verify();
|
|
|
- } else{
|
|
|
- ajax_login(login_type,captchaObj);
|
|
|
- }
|
|
|
- });
|
|
|
- };
|
|
|
+ // $(function () {
|
|
|
+ // var is_need_geetest=0;//全局,是否使用极验.
|
|
|
+ // var login_type=1;//登录模式,1用户账号登录,2用户手机登录,3企业登录.
|
|
|
+ // var gt_call_back=function(captchaObj) {
|
|
|
+ // captchaObj.onReady(function () {
|
|
|
+ // //极验加载完成
|
|
|
+ // });
|
|
|
+ // captchaObj.onSuccess(function () {
|
|
|
+ // ajax_login(login_type,captchaObj);
|
|
|
+ // });
|
|
|
+ // captchaObj.onError(function () {
|
|
|
+ // show_error(login_type,"请先进行验证");
|
|
|
+ // });
|
|
|
+ // captchaObj.onClose(function () {
|
|
|
+ // show_error(login_type,"请先进行验证");
|
|
|
+ // });
|
|
|
+ // $(document).on('click','.login-company', function () {
|
|
|
+ // login_type=3;
|
|
|
+ // clean_message();
|
|
|
+ // if (is_need_geetest==1){
|
|
|
+ // captchaObj.bindForm("#form_company");
|
|
|
+ // captchaObj.verify();
|
|
|
+ // } else{
|
|
|
+ // ajax_login(login_type,captchaObj);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // };
|
|
|
+ //
|
|
|
+ // 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 () {
|
|
|
+ captcha.show();
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
- function ajax_login(type, captchaObj) {
|
|
|
+ function ajax_login(type) {
|
|
|
if (type==3){
|
|
|
$.ajax({
|
|
|
method: 'post',
|
|
@@ -118,7 +144,6 @@
|
|
|
else if(errorData.status==400) {//业务错误
|
|
|
$("#message_company").addClass("errinfo");
|
|
|
$("#message_company").text(errorData.responseJSON.message);
|
|
|
- is_need_geetest=errorData.responseJSON.errors.is_need_geetest;
|
|
|
}
|
|
|
}
|
|
|
});
|