Browse Source

微信登录

linwu 6 months ago
parent
commit
328d648b59
2 changed files with 10 additions and 9 deletions
  1. 1 1
      app/admin/controller/Human.php
  2. 9 8
      app/mobile/controller/Human.php

+ 1 - 1
app/admin/controller/Human.php

@@ -203,7 +203,7 @@ class Human extends AdminBaseController
             $list[$k]['priority']    = 255;
             $list[$k]['create_time'] = $list[$k]['update_time'] = $time;
         }
-        
+
         HumanInstitutionModel::insertAll($list);
 
         ajax_return(0);

+ 9 - 8
app/mobile/controller/Human.php

@@ -17,7 +17,8 @@ class Human extends MobileBaseController
     {
         $open_id = session('mobile.human.open_id');
         if (empty($open_id)) {
-            return redirect('https://www.jucai.gov.cn/api/auth/wechat_auth?url=' . urlencode(url('/mobile/login/humanLogin')));
+            $response = redirect('https://www.jucai.gov.cn/api/auth/wechat_auth?url=' . urlencode(url('/mobile/login/humanLogin')));
+            throw new \think\exception\HttpResponseException($response);
         }
     }
 
@@ -192,17 +193,17 @@ class Human extends MobileBaseController
 
         if (!empty($institution)) {
             if ($institution['status'] != HumanInstitutionApplyModel::STATUS_PASS) {
-                return redirect(url('human/tips'));
+                throw new \think\exception\HttpResponseException(redirect(url('human/tips')));
             } else {
-                return redirect(url('human/enterpriseList'));
+                throw new \think\exception\HttpResponseException(redirect(url('human/enterpriseList')));
             }
         }
 
         if (!empty($enterprise)) {
             if ($enterprise['status'] != HumanEnterpriseApplyModel::STATUS_PASS) {
-                return redirect(url('human/tips'));
+                throw new \think\exception\HttpResponseException(redirect(url('human/tips')));
             } else {
-                return redirect(url('human/institutionList'));
+                throw new \think\exception\HttpResponseException(redirect(url('human/institutionList')));
             }
         }
     }
@@ -214,18 +215,18 @@ class Human extends MobileBaseController
         $institution = HumanInstitutionApplyModel::where('open_id', $open_id)->find();
         $enterprise  = HumanEnterpriseApplyModel::where('open_id', $open_id)->find();
         if (empty($institution) && empty($enterprise)) {
-            return redirect(url('human/index'));
+            throw new \think\exception\HttpResponseException(redirect(url('human/index')));
         }
 
         if (!empty($institution)) {
             if ($institution['status'] != HumanInstitutionApplyModel::STATUS_PASS) {
-                return redirect(url('human/tips'));
+                throw new \think\exception\HttpResponseException(redirect(url('human/tips')));
             }
         }
 
         if (!empty($enterprise)) {
             if ($enterprise['status'] != HumanEnterpriseApplyModel::STATUS_PASS) {
-                return redirect(url('human/tips'));
+                throw new \think\exception\HttpResponseException(redirect(url('human/tips')));
             }
         }