Browse Source

Merge branch 'master' of http://59.57.98.130:3000/jjhc/jucai

linwu 1 năm trước cách đây
mục cha
commit
17e5d880c9

+ 6 - 10
app/Admin/Controllers/Recruit/RecruitController.php

@@ -417,7 +417,7 @@ class RecruitController extends Controller
         if($verify['pen_ticket_content']){
         if($verify['pen_ticket_content']){
             $data['pen_ticket_content'] = $verify['pen_ticket_content'];
             $data['pen_ticket_content'] = $verify['pen_ticket_content'];
         }
         }
-        $data['pen_ticket_status'] = 0;
+        //$data['pen_ticket_status'] = 0;
         if($verify['pen_ticket_field']){
         if($verify['pen_ticket_field']){
             $data['pen_ticket_field'] = implode(',',$verify['pen_ticket_field']);
             $data['pen_ticket_field'] = implode(',',$verify['pen_ticket_field']);
         }
         }
@@ -440,7 +440,7 @@ class RecruitController extends Controller
         if($verify['computer_ticket_content']){
         if($verify['computer_ticket_content']){
             $data['computer_ticket_content'] = $verify['computer_ticket_content'];
             $data['computer_ticket_content'] = $verify['computer_ticket_content'];
         }
         }
-        $data['computer_ticket_status'] = 0;
+        //$data['computer_ticket_status'] = 0;
         if($verify['computer_ticket_field']){
         if($verify['computer_ticket_field']){
             $data['computer_ticket_field'] = implode(',',$verify['computer_ticket_field']);
             $data['computer_ticket_field'] = implode(',',$verify['computer_ticket_field']);
         }
         }
@@ -448,7 +448,7 @@ class RecruitController extends Controller
         if($verify['face_ticket_content']){
         if($verify['face_ticket_content']){
             $data['face_ticket_content'] = $verify['face_ticket_content'];
             $data['face_ticket_content'] = $verify['face_ticket_content'];
         }
         }
-        $data['face_ticket_status'] = 0;
+        //$data['face_ticket_status'] = 0;
         if($verify['face_ticket_field']){
         if($verify['face_ticket_field']){
             $data['face_ticket_field'] = implode(',',$verify['face_ticket_field']);
             $data['face_ticket_field'] = implode(',',$verify['face_ticket_field']);
         }
         }
@@ -464,7 +464,7 @@ class RecruitController extends Controller
         if($verify['reexamine_ticket_content']){
         if($verify['reexamine_ticket_content']){
             $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content'];
             $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content'];
         }
         }
-        $data['reexamine_ticket_status'] = 0;
+        //$data['reexamine_ticket_status'] = 0;
         if($verify['reexamine_field']){
         if($verify['reexamine_field']){
             $data['reexamine_field'] = implode(',',$verify['reexamine_field']);
             $data['reexamine_field'] = implode(',',$verify['reexamine_field']);
         }
         }
@@ -593,7 +593,6 @@ class RecruitController extends Controller
         $data['forms'] = implode(',',array_filter($verify['forms']));
         $data['forms'] = implode(',',array_filter($verify['forms']));
         $data['pen_ticket_type'] = $verify['pen_ticket_type'];
         $data['pen_ticket_type'] = $verify['pen_ticket_type'];
         $data['pen_ticket_content'] = $verify['pen_ticket_content'];
         $data['pen_ticket_content'] = $verify['pen_ticket_content'];
-        $data['pen_ticket_status'] = 0;
         $data['pen_ticket_field'] = implode(',',$verify['pen_ticket_field']);
         $data['pen_ticket_field'] = implode(',',$verify['pen_ticket_field']);
         $data['pen_comfirm'] = $verify['pen_comfirm'];
         $data['pen_comfirm'] = $verify['pen_comfirm'];
         $data['pen_comfirm_start'] = $verify['pen_comfirm_start'] ? $verify['pen_comfirm_start'] : null;
         $data['pen_comfirm_start'] = $verify['pen_comfirm_start'] ? $verify['pen_comfirm_start'] : null;
@@ -604,11 +603,9 @@ class RecruitController extends Controller
         $data['pen_health_end'] = $verify['pen_health_end'] ? $verify['pen_health_end'] : null;
         $data['pen_health_end'] = $verify['pen_health_end'] ? $verify['pen_health_end'] : null;
         $data['computer_ticket_type'] = $verify['computer_ticket_type'];
         $data['computer_ticket_type'] = $verify['computer_ticket_type'];
         $data['computer_ticket_content'] = $verify['computer_ticket_content'];
         $data['computer_ticket_content'] = $verify['computer_ticket_content'];
-        $data['computer_ticket_status'] = 0;
         $data['computer_ticket_field'] = implode(',',$verify['computer_ticket_field']);
         $data['computer_ticket_field'] = implode(',',$verify['computer_ticket_field']);
         $data['face_ticket_type'] = $verify['face_ticket_type'];
         $data['face_ticket_type'] = $verify['face_ticket_type'];
         $data['face_ticket_content'] = $verify['face_ticket_content'];
         $data['face_ticket_content'] = $verify['face_ticket_content'];
-        $data['face_ticket_status'] = 0;
         $data['face_ticket_field'] = implode(',',$verify['face_ticket_field']);
         $data['face_ticket_field'] = implode(',',$verify['face_ticket_field']);
         $data['face_epidemic'] = $verify['face_epidemic'];
         $data['face_epidemic'] = $verify['face_epidemic'];
         $data['face_health'] = $verify['face_health'];
         $data['face_health'] = $verify['face_health'];
@@ -616,7 +613,6 @@ class RecruitController extends Controller
         $data['face_health_end'] = $verify['face_health_end'] ? $verify['face_health_end'] : null;
         $data['face_health_end'] = $verify['face_health_end'] ? $verify['face_health_end'] : null;
         $data['reexamine_ticket_type'] = $verify['reexamine_ticket_type'];
         $data['reexamine_ticket_type'] = $verify['reexamine_ticket_type'];
         $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content'];
         $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content'];
-        $data['reexamine_ticket_status'] = 0;
         $data['reexamine_field'] = implode(',',$verify['reexamine_field']);
         $data['reexamine_field'] = implode(',',$verify['reexamine_field']);
         $ids = RecruitPost::where('recruit_id', $recruit_id)->pluck('id');
         $ids = RecruitPost::where('recruit_id', $recruit_id)->pluck('id');
         $fileCharater = $request->input('addFile');
         $fileCharater = $request->input('addFile');
@@ -2720,7 +2716,7 @@ class RecruitController extends Controller
             ->get();
             ->get();
         $data = [];
         $data = [];
         foreach ($list as $k => $v){
         foreach ($list as $k => $v){
-            $place = $v->ex_place == null ? "{$v->ex_room}考场" : $v->ex_place;
+            $place = $v->ex_place == null ? "{$v->ex_room}" : $v->ex_place;
             if(!array_key_exists($place,$data)){
             if(!array_key_exists($place,$data)){
                 $data[$place] = [];
                 $data[$place] = [];
             }
             }
@@ -2752,7 +2748,7 @@ class RecruitController extends Controller
             ->get();
             ->get();
         $data = [];
         $data = [];
         foreach ($list as $k => $v){
         foreach ($list as $k => $v){
-            $place = $v->ex_place == null ? "{$v->ex_room}考场" : $v->ex_place;
+            $place = $v->ex_place == null ? "{$v->ex_room}" : $v->ex_place;
             if(!array_key_exists($place,$data)){
             if(!array_key_exists($place,$data)){
                 $data[$place] = [];
                 $data[$place] = [];
             }
             }

+ 6 - 5
app/Admin/Controllers/Recruit/RecruitTicketController.php

@@ -390,11 +390,12 @@ class RecruitTicketController extends Controller
                                     'ex_room' => $sheet->getCell("F{$row}")->getValue(),
                                     'ex_room' => $sheet->getCell("F{$row}")->getValue(),
                                     'ex_seat' => $sheet->getCell("G{$row}")->getValue(),
                                     'ex_seat' => $sheet->getCell("G{$row}")->getValue(),
                                     'ex_time' => $sheet->getCell("H{$row}")->getValue(),
                                     'ex_time' => $sheet->getCell("H{$row}")->getValue(),
-                                    'ex_address' => $sheet->getCell("I{$row}")->getValue(),
-                                    'ex_ready_time' => $sheet->getCell("J{$row}")->getValue(),
-                                    'extra1' => $sheet->getCell("K{$row}")->getValue(),
-                                    'extra2' => $sheet->getCell("L{$row}")->getValue(),
-                                    'extra3' => $sheet->getCell("M{$row}")->getValue()
+                                    'ex_place' => $sheet->getCell("I{$row}")->getValue(),
+                                    'ex_address' => $sheet->getCell("J{$row}")->getValue(),
+                                    'ex_ready_time' => $sheet->getCell("K{$row}")->getValue(),
+                                    'extra1' => $sheet->getCell("L{$row}")->getValue(),
+                                    'extra2' => $sheet->getCell("M{$row}")->getValue(),
+                                    'extra3' => $sheet->getCell("N{$row}")->getValue()
                                 ];
                                 ];
                             }
                             }
                             Recruit::where('id',$data['recruit_id'])->update(['face_ticket_status' => 1]);
                             Recruit::where('id',$data['recruit_id'])->update(['face_ticket_status' => 1]);

+ 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\Http\Controllers\Web\WebBaseController;
 use App\Services\Auth\AuthService;
 use App\Services\Auth\AuthService;
 use App\Services\Common\GeetestService;
 use App\Services\Common\GeetestService;
+use App\Services\Common\TencentCaptchaService;
 use App\Services\Common\SmsService;
 use App\Services\Common\SmsService;
 use App\Validators\AuthValidatorRequest;
 use App\Validators\AuthValidatorRequest;
 use Closure;
 use Closure;
@@ -29,6 +30,8 @@ class LoginController extends WebBaseController
      */
      */
     protected $geetestService;
     protected $geetestService;
 
 
+    protected $tencentCaptchaService;
+
 
 
     /**
     /**
      * LoginController constructor.
      * LoginController constructor.
@@ -39,11 +42,13 @@ class LoginController extends WebBaseController
     public function __construct(
     public function __construct(
         AuthService $authService,
         AuthService $authService,
         SmsService $smsService,
         SmsService $smsService,
-        GeetestService $geetestService
+        GeetestService $geetestService,
+        TencentCaptchaService $tencentCaptchaService
     ) {
     ) {
         $this->authService = $authService;
         $this->authService = $authService;
         $this->smsService = $smsService;
         $this->smsService = $smsService;
         $this->geetestService = $geetestService;
         $this->geetestService = $geetestService;
+        $this->tencentCaptchaService = $tencentCaptchaService;
         $this->middleware(function ($request, Closure $next) {
         $this->middleware(function ($request, Closure $next) {
             if ($request->route()->getName() != 'logout') {
             if ($request->route()->getName() != 'logout') {
                 if (Auth::guard('web-member')->check() || Auth::guard('web-company')->check() || Auth::guard('web-organization')->check()) {
                 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)
     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)) {
         if (!$member=$this->authService->loginByAccount($request->account, $request->password, $request->autoLogin)) {
@@ -118,9 +127,13 @@ class LoginController extends WebBaseController
 
 
     public function loginBySms(AuthValidatorRequest $request)
     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(
         if (!$this->smsService->checkAuthSms(
             $request->mobile,
             $request->mobile,
             Smser::TEMPLATE_AUTH_LOGIN,
             Smser::TEMPLATE_AUTH_LOGIN,
@@ -149,9 +162,12 @@ class LoginController extends WebBaseController
 
 
     public function loginByCompany(AuthValidatorRequest $request)
     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(
         if (!$company=$this->authService->loginByCompany(
             $request->company_account,
             $request->company_account,
             $request->company_password,
             $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;
+        }
+
+    }
+
+}

+ 150 - 104
public/themes/default/views/app/auth/login.blade.php

@@ -36,6 +36,9 @@
 
 
                         <div class="login-type user-login">
                         <div class="login-type user-login">
                             <form id="form_account" action="{{route('login.account')}}" method="post">
                             <form id="form_account" action="{{route('login.account')}}" 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() }}
                                 {{ csrf_field() }}
                                 <div id="account"></div>
                                 <div id="account"></div>
                                 <div id="message_account"></div>
                                 <div id="message_account"></div>
@@ -62,6 +65,9 @@
                     <!--手机登录-->
                     <!--手机登录-->
                     <div class="login-type mob-login" style="display: none;">
                     <div class="login-type mob-login" style="display: none;">
                         <form id="form_mobile" action="{{route('login.sms')}}" method="post">
                         <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() }}
                             {{ csrf_field() }}
                         <div id="mobile"></div>
                         <div id="mobile"></div>
                         <div id="message_mobile"></div>
                         <div id="message_mobile"></div>
@@ -116,74 +122,154 @@
     @include('module.widgets.thirdlogin')
     @include('module.widgets.thirdlogin')
     <script>
     <script>
         $(function () {
         $(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', 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){
-            //     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){
             $(".input-login").keydown(function(ev){
                 ev = ev || window.event;
                 ev = ev || window.event;
@@ -198,45 +284,7 @@
                 $(this).addClass("active").siblings("span").removeClass("active");
                 $(this).addClass("active").siblings("span").removeClass("active");
                 $(".login-type").eq(index).show().siblings(".login-type").hide();
                 $(".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(){
             $(".register_user").click(function(){
 				 var url=$(this).attr("url")
 				 var url=$(this).attr("url")
@@ -251,7 +299,8 @@
             })
             })
 
 
 
 
-            function ajax_login(type, captchaObj) {
+            function ajax_login(type) {
+                console.log(type)
                 if (type==1) {
                 if (type==1) {
                     $.ajax({
                     $.ajax({
                         method: 'post',
                         method: 'post',
@@ -277,9 +326,7 @@
                             location.href=data.data.redirect_url;
                             location.href=data.data.redirect_url;
                         },
                         },
                         error: function (errorData) {
                         error: function (errorData) {
-                            if (is_need_geetest==1){
-                                captchaObj.reset();
-                            }
+
                             if (errorData.status==422) {//验证错误
                             if (errorData.status==422) {//验证错误
                                 $.each(errorData.responseJSON.errors,function (key,val) {
                                 $.each(errorData.responseJSON.errors,function (key,val) {
                                     $("#"+key).addClass("errinfo");
                                     $("#"+key).addClass("errinfo");
@@ -289,7 +336,6 @@
                             else if(errorData.status==400) {//业务错误
                             else if(errorData.status==400) {//业务错误
                                 $("#message_account").addClass("errinfo");
                                 $("#message_account").addClass("errinfo");
                                 $("#message_account").text(errorData.responseJSON.message);
                                 $("#message_account").text(errorData.responseJSON.message);
-                                is_need_geetest=errorData.responseJSON.errors.is_need_geetest;
                             }
                             }
                         }
                         }
                     });
                     });

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

@@ -11,6 +11,7 @@
 @push('js')
 @push('js')
     <script type="text/javascript" src="{{ theme_asset('gt/gt.js') }}"></script>
     <script type="text/javascript" src="{{ theme_asset('gt/gt.js') }}"></script>
     <script type="text/javascript" src="{{ theme_asset('gt/gt.handle.js') }}"></script>
     <script type="text/javascript" src="{{ theme_asset('gt/gt.handle.js') }}"></script>
+    <script src="https://captcha.253.com/TCaptcha.js"></script>
 @endpush
 @endpush
 
 
 @section('content')
 @section('content')
@@ -28,6 +29,9 @@
                     <div class="user-login">
                     <div class="user-login">
                         <form id="form_company" action="{{route('login.company')}}" method="post">
                         <form id="form_company" action="{{route('login.company')}}" method="post">
                             {{ csrf_field() }}
                             {{ 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="company_account"></div>
                             <div id="message_company"></div>
                             <div id="message_company"></div>
                         <div class="form-group yhm">
                         <div class="form-group yhm">
@@ -76,61 +80,83 @@
     @include('module.widgets.thirdlogin')
     @include('module.widgets.thirdlogin')
     <script>
     <script>
         $(function () {
         $(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){
             $(".input-login").keydown(function(ev){
                 ev = ev || window.event;
                 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) {
             function show_error(type,message) {

+ 55 - 30
public/themes/default/views/app/common/ajax/com_login.blade.php

@@ -5,6 +5,9 @@
             <div class="form-l">
             <div class="form-l">
                 <div class="user-login">
                 <div class="user-login">
                     <form id="form_company" action="{{route('login.company')}}" method="post">
                     <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() }}
                         {{ csrf_field() }}
                         <div id="company_account"></div>
                         <div id="company_account"></div>
                         <div id="message_company"></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.js') }}"></script>
 <script type="text/javascript" src="{{ theme_asset('gt/gt.handle.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])
 @include('module.widgets.thirdlogin', ['redirect_url'=>$redirect_url])
 
 
 {{--@section('script')--}}
 {{--@section('script')--}}
     <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){
                 if (type==3){
                     $.ajax({
                     $.ajax({
                         method: 'post',
                         method: 'post',
@@ -118,7 +144,6 @@
                             else if(errorData.status==400) {//业务错误
                             else if(errorData.status==400) {//业务错误
                                 $("#message_company").addClass("errinfo");
                                 $("#message_company").addClass("errinfo");
                                 $("#message_company").text(errorData.responseJSON.message);
                                 $("#message_company").text(errorData.responseJSON.message);
-                                is_need_geetest=errorData.responseJSON.errors.is_need_geetest;
                             }
                             }
                         }
                         }
                     });
                     });

+ 149 - 52
public/themes/default/views/app/common/ajax/per_login.blade.php

@@ -10,6 +10,9 @@
                 <!--普通用户登录-->
                 <!--普通用户登录-->
                 <div class="login-type user-login">
                 <div class="login-type user-login">
                     <form id="form_account" action="{{route('login.account')}}" method="post">
                     <form id="form_account" action="{{route('login.account')}}" 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() }}
                         {{ csrf_field() }}
                         <div id="account"></div>
                         <div id="account"></div>
                         <div id="message_account"></div>
                         <div id="message_account"></div>
@@ -36,6 +39,9 @@
                 <!--手机登录-->
                 <!--手机登录-->
                 <div class="login-type mob-login" style="display: none;">
                 <div class="login-type mob-login" style="display: none;">
                     <form id="form_mobile" action="{{route('login.sms')}}" method="post">
                     <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() }}
                         {{ csrf_field() }}
                         <div id="mobile"></div>
                         <div id="mobile"></div>
                         <div id="message_mobile"></div>
                         <div id="message_mobile"></div>
@@ -83,65 +89,157 @@
 </div>
 </div>
 <script type="text/javascript" src="{{ theme_asset('gt/gt.js') }}"></script>
 <script type="text/javascript" src="{{ theme_asset('gt/gt.js') }}"></script>
 <script type="text/javascript" src="{{ theme_asset('gt/gt.handle.js') }}"></script>
 <script type="text/javascript" src="{{ theme_asset('gt/gt.handle.js') }}"></script>
+<script type="text/javascript" src="https://captcha.253.com/TCaptcha.js"></script>
 @include('module.widgets.thirdlogin', ['redirect_url'=>$redirect_url])
 @include('module.widgets.thirdlogin', ['redirect_url'=>$redirect_url])
 <script>
 <script>
     $(function () {
     $(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);
+        //         }
+        //     });
+        // };
+        //
+        // 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);
+        }
 
 
-            });
-            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', 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 mobile_captcha = new TencentCaptcha('196587903', mobile_captcha_callback, {});
+        $('.btn-getcode').on('click', function () {
+            mobile_captcha.show();
 
 
-        gt_init(gt_call_back);//初始化极验
+        });
+
+        $('.login-mobile').on('click', function () {
+            login_type=2;
 
 
+            if (mobile_captcha_flag){
+                ajax_login(2);
+            }
+            else{
+                alert('验证码组件异常')
+            }
+        });
 
 
         $(document).on("click",".switch-title span",function () {
         $(document).on("click",".switch-title span",function () {
             var index = $(this).index();
             var index = $(this).index();
@@ -193,7 +291,7 @@
         });
         });
 
 
 
 
-        function ajax_login(type, captchaObj) {
+        function ajax_login(type) {
             if (type==1) {
             if (type==1) {
                 $.ajax({
                 $.ajax({
                     method: 'post',
                     method: 'post',
@@ -225,7 +323,6 @@
                         else if(errorData.status==400) {//业务错误
                         else if(errorData.status==400) {//业务错误
                             $("#message_account").addClass("errinfo");
                             $("#message_account").addClass("errinfo");
                             $("#message_account").text(errorData.responseJSON.message);
                             $("#message_account").text(errorData.responseJSON.message);
-                            is_need_geetest=errorData.responseJSON.errors.is_need_geetest;
                         }
                         }
                     }
                     }
                 });
                 });

+ 1 - 0
public/themes/default/views/module/section/html_start.blade.php

@@ -21,6 +21,7 @@
     <!-- Styles -->
     <!-- Styles -->
     @stack('css')
     @stack('css')
     <script type="text/javascript" src="{{theme_asset('jquery/jquery-1.12.4.min.js')}}"></script>
     <script type="text/javascript" src="{{theme_asset('jquery/jquery-1.12.4.min.js')}}"></script>
+    <script src="https://captcha.253.com/TCaptcha.js"></script>
     @stack('js')
     @stack('js')
 </head>
 </head>
 <body>
 <body>