فهرست منبع

更新验证码

sandm 1 سال پیش
والد
کامیت
d93e0caf83

+ 23 - 7
app/Http/Controllers/Web/Auth/LoginController.php

@@ -6,6 +6,7 @@ use Aix\Sms\Contracts\Smser;
 use App\Http\Controllers\Web\WebBaseController;
 use App\Services\Auth\AuthService;
 use App\Services\Common\GeetestService;
+use App\Services\Common\TencentCaptchaService;
 use App\Services\Common\SmsService;
 use App\Validators\AuthValidatorRequest;
 use Closure;
@@ -29,6 +30,8 @@ class LoginController extends WebBaseController
      */
     protected $geetestService;
 
+    protected $tencentCaptchaService;
+
 
     /**
      * LoginController constructor.
@@ -39,11 +42,13 @@ class LoginController extends WebBaseController
     public function __construct(
         AuthService $authService,
         SmsService $smsService,
-        GeetestService $geetestService
+        GeetestService $geetestService,
+        TencentCaptchaService $tencentCaptchaService
     ) {
         $this->authService = $authService;
         $this->smsService = $smsService;
         $this->geetestService = $geetestService;
+        $this->tencentCaptchaService = $tencentCaptchaService;
         $this->middleware(function ($request, Closure $next) {
             if ($request->route()->getName() != 'logout') {
                 if (Auth::guard('web-member')->check() || Auth::guard('web-company')->check() || Auth::guard('web-organization')->check()) {
@@ -81,8 +86,12 @@ class LoginController extends WebBaseController
 
     public function loginByAccount(AuthValidatorRequest $request)
     {
-        if (!$this->geetestService->checkGeetest(config('aix.system.site_safety.site_vo_code.members_login'))) {
-            return $this->sendErrorResponse("验证码不通过,请重新验证", ['is_need_geetest'=>1]);
+//        if (!$this->geetestService->checkGeetest(config('aix.system.site_safety.site_vo_code.members_login'))) {
+//            return $this->sendErrorResponse("验证码不通过,请重新验证", ['is_need_geetest'=>1]);
+//        }
+
+        if(!$this->tencentCaptchaService->check($request->input('randstr'),$request->input('ticket'),$request->ip())){
+            return $this->sendErrorResponse("验证码不通过,请重新验证");
         }
 
         if (!$member=$this->authService->loginByAccount($request->account, $request->password, $request->autoLogin)) {
@@ -118,9 +127,13 @@ class LoginController extends WebBaseController
 
     public function loginBySms(AuthValidatorRequest $request)
     {
-        if (!$this->geetestService->checkGeetest(config('aix.system.site_safety.site_vo_code.members_login'))) {
-            return $this->sendErrorResponse("验证码不通过,请重新验证", ['is_need_geetest'=>1]);
+        if(!$this->tencentCaptchaService->check($request->input('randstr'),$request->input('ticket'),$request->ip())){
+            return $this->sendErrorResponse("验证码不通过,请重新验证");
         }
+
+//        if (!$this->geetestService->checkGeetest(config('aix.system.site_safety.site_vo_code.members_login'))) {
+//            return $this->sendErrorResponse("验证码不通过,请重新验证", ['is_need_geetest'=>1]);
+//        }
         if (!$this->smsService->checkAuthSms(
             $request->mobile,
             Smser::TEMPLATE_AUTH_LOGIN,
@@ -149,9 +162,12 @@ class LoginController extends WebBaseController
 
     public function loginByCompany(AuthValidatorRequest $request)
     {
-        if (!$this->geetestService->checkGeetest(config('aix.system.site_safety.site_vo_code.members_login'))) {
-            return $this->sendErrorResponse("验证码不通过,请重新验证", ['is_need_geetest'=>1]);
+        if(!$this->tencentCaptchaService->check($request->input('randstr'),$request->input('ticket'),$request->ip())){
+            return $this->sendErrorResponse("验证码不通过,请重新验证");
         }
+//        if (!$this->geetestService->checkGeetest(config('aix.system.site_safety.site_vo_code.members_login'))) {
+//            return $this->sendErrorResponse("验证码不通过,请重新验证", ['is_need_geetest'=>1]);
+//        }
         if (!$company=$this->authService->loginByCompany(
             $request->company_account,
             $request->company_password,

+ 53 - 0
app/Services/Common/TencentCaptchaService.php

@@ -0,0 +1,53 @@
+<?php
+
+namespace App\Services\Common;
+
+use Illuminate\Support\Facades\Cache;
+
+
+class TencentCaptchaService{
+
+    private $appId = 'kJuJadQt';
+
+    private $appKey = 'QPk34Fzi';
+
+    private $AppSecretKey = '5wWzxbiTgcREfZVMAj3m1PoZC';
+
+    private $CaptchaAppId = '196587903';
+
+    protected $client;
+
+    public function __construct()
+    {
+        $this->client = new CurlService();
+
+    }
+
+    public function check($RendStr, $Ticket, $ip)
+    {
+        if (empty($RendStr) || empty($Ticket) || empty($ip)) {
+            return false;
+        }
+
+        $data= [
+            'appId' =>  $this->appId,
+            'appKey' => $this->appKey,
+            'AppSecretKey' => $this->AppSecretKey,
+            'CaptchaAppId' => $this->CaptchaAppId,
+            'RendStr' => $RendStr,
+            'Ticket' => $Ticket,
+            'IP' => $ip
+        ];
+
+
+        $res = $this->client->post("https://api.253.com/open/txyzm/yzm-v2",$data);
+
+        if($res->code == '200000'){
+            return true;
+        }else{
+            return false;
+        }
+
+    }
+
+}

+ 146 - 111
public/themes/default/views/app/auth/login.blade.php

@@ -65,6 +65,9 @@
                     <!--手机登录-->
                     <div class="login-type mob-login" style="display: none;">
                         <form id="form_mobile" action="{{route('login.sms')}}" method="post">
+                            <input type="hidden" name="ticket" id="ticket1">
+                            <input type="hidden" name="bizState" id="bizState1">
+                            <input type="hidden" name="randstr" id="randstr1">
                             {{ csrf_field() }}
                         <div id="mobile"></div>
                         <div id="message_mobile"></div>
@@ -119,85 +122,154 @@
     @include('module.widgets.thirdlogin')
     <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);
+            // 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,"请先进行验证");
+            //     });
+            //     $('.login-account').on('click', function () {
+            //         login_type=1;
+            //         //clean_message();
+            //         if (is_need_geetest==1){
+            //             captchaObj.bindForm("#form_account");
+            //             captchaObj.verify();
+            //         }
+            //         else{
+            //             ajax_login(login_type,captchaObj);
+            //         }
+            //
+            //     });
+            //
+            //     $('.login-mobile').on('click', function () {
+            //         login_type=2;
+            //         //clean_message();
+            //         if (is_need_geetest==1){
+            //             captchaObj.bindForm("#form_mobile");
+            //             captchaObj.verify();
+            //         }
+            //         else{
+            //             ajax_login(login_type,captchaObj);
+            //         }
+            //     });
+            //
+            //     $('.login-company').on('click', function () {
+            //         login_type=3;
+            //         //clean_message();
+            //         if (is_need_geetest==1){
+            //             captchaObj.bindForm("#form_company");
+            //             captchaObj.verify();
+            //         }
+            //         else{
+            //             ajax_login(login_type,captchaObj);
+            //         }
+            //     });
+            // };
+
+            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);
+            }
 
-                });
-                captchaObj.onError(function () {
-                    show_error(login_type,"请先进行验证");
-                });
-                captchaObj.onClose(function () {
-                    show_error(login_type,"请先进行验证");
-                });
-                $('.login-account').on('click', function () {
-                    login_type=1;
-                    //clean_message();
-                    if (is_need_geetest==1){
-                        captchaObj.bindForm("#form_account");
-                        captchaObj.verify();
-                    }
-                    else{
-                        ajax_login(login_type,captchaObj);
-                    }
+            var mobile_captcha_flag = false;
+            var mobile_captcha_callback = function(res){
+                if(res.hasOwnProperty('errorMessage')){
+                    alert(res.errorMessage)
+                }
+                if(res.ret == 0){
+                    mobile_captcha_flag = true;
+                    console.log('行为验证通过');
+                    $("#ticket1").val(res.ticket);
+                    $("#bizState1").val(res.bizState);
+                    $("#randstr1").val(res.randstr);
+                    submit_data={
+                        "mobile":$("input[name='mobile']").val(),
+                        "type":"login"
+                    };
+                    $.ajax({
+                        method: 'post',
+                        url: '{{route('sms.send')}}',
+                        data: submit_data,
+                        beforeSend:function () {
+                            // console.log('请求开始');
+                            $(".errinfo").text("");
+                            $(".errinfo").removeClass("errinfo");
 
-                });
+                        },
+                        complete:function() {
+                            console.log('请求结束');
+                        },
+                        success: function (data) {
+                            // console.log(data);
+                            $("#message_mobile").addClass("successinfo");
+                            $("#message_mobile").text("发送成功,请注意查收");
+                            settime();
+                        },
+                        error: function (errorData) {
+                            // console.log(errorData);
+                            if (errorData.status==422) {//验证错误
+                                $.each(errorData.responseJSON.errors,function (key,val) {
+                                    $("#"+key).addClass("errinfo");
+                                    $("#"+key).text(val[0]);
+                                });
+                            }
+                            else if(errorData.status==400) {//业务错误
+                                $("#message_mobile").addClass("errinfo");
+                                $("#message_mobile").text(errorData.responseJSON.message);
+                            }
+                        }
+                    });
+                }else{
+                    console.log('用户主动关闭验证码')
+                }
+                console.log('callback:', res);
+            }
 
-                $('.login-mobile').on('click', function () {
-                    login_type=2;
-                    //clean_message();
-                    if (is_need_geetest==1){
-                        captchaObj.bindForm("#form_mobile");
-                        captchaObj.verify();
-                    }
-                    else{
-                        ajax_login(login_type,captchaObj);
-                    }
-                });
+            var captcha = new TencentCaptcha('196587903', mobile_captcha_callback, {});
+            $('.login-account').on('click', function () {
+                captcha.show();
 
-                $('.login-company').on('click', function () {
-                    login_type=3;
-                    //clean_message();
-                    if (is_need_geetest==1){
-                        captchaObj.bindForm("#form_company");
-                        captchaObj.verify();
-                    }
-                    else{
-                        ajax_login(login_type,captchaObj);
-                    }
-                });
-            };
+            });
 
-            // 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,captchaObj);
-            //     }else{
-            //         console.log('用户主动关闭验证码')
-            //     }
-            //     console.log('callback:', res);
-            // }
-            //
-            // var captcha = new TencentCaptcha('196587903', captcha_callback, {});
-            // $('.login-account').on('click', function () {
-            //     captcha.show();
-            //
-            // });
+            var mobile_captcha = new TencentCaptcha('196587903', mobile_captcha_callback, {});
+            $('.btn-getcode').on('click', function () {
+                mobile_captcha.show();
+
+            });
 
+            $('.login-mobile').on('click', function () {
+                login_type=2;
 
+                if (mobile_captcha_flag){
+                    ajax_login(2);
+                }
+                else{
+                    alert('验证码组件异常')
+                }
+            });
 
-            gt_init(gt_call_back);//初始化极验
+            //gt_init(gt_call_back);//初始化极验
 
             $(".input-login").keydown(function(ev){
                 ev = ev || window.event;
@@ -212,45 +284,7 @@
                 $(this).addClass("active").siblings("span").removeClass("active");
                 $(".login-type").eq(index).show().siblings(".login-type").hide();
             });
-            $('.btn-getcode').on('click', function () {
-                submit_data={
-                    "mobile":$("input[name='mobile']").val(),
-                    "type":"login"
-                };
-                $.ajax({
-                    method: 'post',
-                    url: '{{route('sms.send')}}',
-                    data: submit_data,
-                    beforeSend:function () {
-                       // console.log('请求开始');
-                        $(".errinfo").text("");
-                        $(".errinfo").removeClass("errinfo");
-
-                    },
-                    complete:function() {
-                        console.log('请求结束');
-                    },
-                    success: function (data) {
-                       // console.log(data);
-                        $("#message_mobile").addClass("successinfo");
-                        $("#message_mobile").text("发送成功,请注意查收");
-                        settime();
-                    },
-                    error: function (errorData) {
-                       // console.log(errorData);
-                        if (errorData.status==422) {//验证错误
-                            $.each(errorData.responseJSON.errors,function (key,val) {
-                                $("#"+key).addClass("errinfo");
-                                $("#"+key).text(val[0]);
-                            });
-                        }
-                        else if(errorData.status==400) {//业务错误
-                            $("#message_mobile").addClass("errinfo");
-                            $("#message_mobile").text(errorData.responseJSON.message);
-                        }
-                    }
-                });
-            });
+
 
             $(".register_user").click(function(){
 				 var url=$(this).attr("url")
@@ -265,7 +299,8 @@
             })
 
 
-            function ajax_login(type, captchaObj) {
+            function ajax_login(type) {
+                console.log(type)
                 if (type==1) {
                     $.ajax({
                         method: 'post',

+ 118 - 179
public/themes/default/views/app/auth/login_company.blade.php

@@ -11,6 +11,7 @@
 @push('js')
     <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>
 @endpush
 
 @section('content')
@@ -28,6 +29,9 @@
                     <div class="user-login">
                         <form id="form_company" action="{{route('login.company')}}" method="post">
                             {{ csrf_field() }}
+                            <input type="hidden" name="ticket" id="ticket">
+                            <input type="hidden" name="bizState" id="bizState">
+                            <input type="hidden" name="randstr" id="randstr">
                             <div id="company_account"></div>
                             <div id="message_company"></div>
                         <div class="form-group yhm">
@@ -76,61 +80,83 @@
     @include('module.widgets.thirdlogin')
     <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,"请先进行验证");
-                });
-                $('.login-account').on('click', function () {
-                    login_type=1;
-                    //clean_message();
-                    if (is_need_geetest==1){
-                        captchaObj.bindForm("#form_account");
-                        captchaObj.verify();
-                    }
-                    else{
-                        ajax_login(login_type,captchaObj);
-                    }
-
-                });
-
-                $('.login-mobile').on('click', function () {
-                    login_type=2;
-                    //clean_message();
-                    if (is_need_geetest==1){
-                        captchaObj.bindForm("#form_mobile");
-                        captchaObj.verify();
-                    }
-                    else{
-                        ajax_login(login_type,captchaObj);
-                    }
-                });
+            //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,"请先进行验证");
+            //     });
+            //     $('.login-account').on('click', function () {
+            //         login_type=1;
+            //         //clean_message();
+            //         if (is_need_geetest==1){
+            //             captchaObj.bindForm("#form_account");
+            //             captchaObj.verify();
+            //         }
+            //         else{
+            //             ajax_login(login_type,captchaObj);
+            //         }
+            //
+            //     });
+            //
+            //     $('.login-mobile').on('click', function () {
+            //         login_type=2;
+            //         //clean_message();
+            //         if (is_need_geetest==1){
+            //             captchaObj.bindForm("#form_mobile");
+            //             captchaObj.verify();
+            //         }
+            //         else{
+            //             ajax_login(login_type,captchaObj);
+            //         }
+            //     });
+            //
+            //     $('.login-company').on('click', 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);//初始化极验
+
+            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();
+                }else{
+                    console.log('用户主动关闭验证码')
+                }
+                console.log('callback:', res);
+            }
 
-                $('.login-company').on('click', function () {
-                    login_type=3;
-                    //clean_message();
-                    if (is_need_geetest==1){
-                        captchaObj.bindForm("#form_company");
-                        captchaObj.verify();
-                    }
-                    else{
-                        ajax_login(login_type,captchaObj);
-                    }
-                });
-            };
+            var captcha = new TencentCaptcha('196587903', captcha_callback, {});
+            $('.login-company').on('click', function () {
+                captcha.show();
+            });
 
-            gt_init(gt_call_back);//初始化极验
 
             $(".input-login").keydown(function(ev){
                 ev = ev || window.event;
@@ -186,134 +212,47 @@
             });
 
 
-            function ajax_login(type, captchaObj) {
-                if (type==1) {
-                    $.ajax({
-                        method: 'post',
-                        url: $("#form_account").attr('action'),
-                        data: $("#form_account").serialize(),
-                        beforeSend:function () {
-                            //console.log('请求开始');
-                            clean_message();
-                            $('.login-account').addClass("btn-disabled").prop('disabled', true);
-                            $('.login-account').val("登录中...");
-
-                        },
-                        complete:function() {
-                            //console.log('请求结束');
-                            $('.login-account').val("登录");
-                            $('.login-account').removeClass("btn-disabled").prop('disabled', false);
-
-                        },
-                        success: function (data) {
-                            //console.log(data);
-                            $("#message_account").addClass("successinfo");
-                            $("#message_account").text("登录成功, 正在跳转...");
-                            location.href=data.data.redirect_url;
-                        },
-                        error: function (errorData) {
-                            if (is_need_geetest==1){
-                                captchaObj.reset();
-                            }
-                            if (errorData.status==422) {//验证错误
-                                $.each(errorData.responseJSON.errors,function (key,val) {
-                                    $("#"+key).addClass("errinfo");
-                                    $("#"+key).text(val[0]);
-                                });
-                            }
-                            else if(errorData.status==400) {//业务错误
-                                $("#message_account").addClass("errinfo");
-                                $("#message_account").text(errorData.responseJSON.message);
-                                is_need_geetest=errorData.responseJSON.errors.is_need_geetest;
-                            }
-                        }
-                    });
-                }
-                else if (type==2) {
-                    $.ajax({
-                        method: 'post',
-                        url: $("#form_mobile").attr('action'),
-                        data: $("#form_mobile").serialize(),
-                        beforeSend:function () {
-                            //console.log('请求开始');
-                            clean_message();
-                            $('.login-mobile').addClass("btn-disabled").prop('disabled', true);
-                            $('.login-mobile').val("登录中...");
-
-                        },
-                        complete:function() {
-                            //console.log('请求结束');
-                            $('.login-mobile').val("登录");
-                            $('.login-mobile').removeClass("btn-disabled").prop('disabled', false);
-                        },
-                        success: function (data) {
-                            //console.log(data);
-                            $("#message_mobile").addClass("successinfo");
-                            $("#message_mobile").text("登录成功, 正在跳转...");
-                            location.href=data.data.redirect_url;
-                        },
-                        error: function (errorData) {
-                            //console.log(errorData);
-                            if (is_need_geetest==1){
-                                captchaObj.reset();
-                            }
-                            if (errorData.status==422) {//验证错误
-                                $.each(errorData.responseJSON.errors,function (key,val) {
-                                    $("#"+key).addClass("errinfo");
-                                    $("#"+key).text(val[0]);
-                                });
-                            }
-                            else if(errorData.status==400) {//业务错误
-                                $("#message_mobile").addClass("errinfo");
-                                $("#message_mobile").text(errorData.responseJSON.message);
-                                is_need_geetest=errorData.responseJSON.errors.is_need_geetest;
-                            }
+            function ajax_login(type) {
+
+                $.ajax({
+                    method: 'post',
+                    url: $("#form_company").attr('action'),
+                    data: $("#form_company").serialize(),
+                    beforeSend:function () {
+                        //console.log('请求开始');
+                        clean_message();
+                        $('.login-company').addClass("btn-disabled").prop('disabled', true);
+                        $('.login-company').val("登录中...");
+
+                    },
+                    complete:function() {
+                        //console.log('请求结束');
+                        $('.login-company').val("登录");
+                        $('.login-company').removeClass("btn-disabled").prop('disabled', false);
+
+                    },
+                    success: function (data) {
+                        //console.log(data);
+                        $("#message_company").addClass("successinfo");
+                        $("#message_company").text("登录成功, 正在跳转...");
+                        location.href=data.data.redirect_url;
+                    },
+                    error: function (errorData) {
+                        //console.log(errorData);
+
+                        if (errorData.status==422) {//验证错误
+                            $.each(errorData.responseJSON.errors,function (key,val) {
+                                $("#"+key).addClass("errinfo");
+                                $("#"+key).text(val[0]);
+                            });
                         }
-                    });
-                }
-                else if (type==3){
-                    $.ajax({
-                        method: 'post',
-                        url: $("#form_company").attr('action'),
-                        data: $("#form_company").serialize(),
-                        beforeSend:function () {
-                            //console.log('请求开始');
-                            clean_message();
-                            $('.login-company').addClass("btn-disabled").prop('disabled', true);
-                            $('.login-company').val("登录中...");
-
-                        },
-                        complete:function() {
-                            //console.log('请求结束');
-                            $('.login-company').val("登录");
-                            $('.login-company').removeClass("btn-disabled").prop('disabled', false);
-
-                        },
-                        success: function (data) {
-                            //console.log(data);
-                            $("#message_company").addClass("successinfo");
-                            $("#message_company").text("登录成功, 正在跳转...");
-                            location.href=data.data.redirect_url;
-                        },
-                        error: function (errorData) {
-                            //console.log(errorData);
-                            if (is_need_geetest==1){
-                                captchaObj.reset();
-                            }
-                            if (errorData.status==422) {//验证错误
-                                $.each(errorData.responseJSON.errors,function (key,val) {
-                                    $("#"+key).addClass("errinfo");
-                                    $("#"+key).text(val[0]);
-                                });
-                            }
-                            else if(errorData.status==400) {//业务错误
-                                $("#message_company").addClass("errinfo");
-                                $("#message_company").text(errorData.responseJSON.message);
-                                is_need_geetest=errorData.responseJSON.errors.is_need_geetest;
-                            }
+                        else if(errorData.status==400) {//业务错误
+                            $("#message_company").addClass("errinfo");
+                            $("#message_company").text(errorData.responseJSON.message);
                         }
-                    });
-                }
+                    }
+                });
+
             };
 
             function show_error(type,message) {