quguofeng 1 rok temu
rodzic
commit
f4d0eef1a6

+ 5 - 5
application/api/controller/Base.php

@@ -49,9 +49,9 @@ class Base extends Controller
         $this->page = input('page',1) > 0 ? input('page',1) : 1;
         $this->page_num = input('page_num',20);
         $this->off_set   =   $this->page * $this->page_num - $this->page_num;
-        //$this->is_test = input('test',0);// 测试用的  // 上线需要注释
+        $this->is_test = input('test',0);// 测试用的  // 上线需要注释
         $path = explode('/',$this->request->path());
-        //if( input('user_id')) $this->user_id = input('user_id');// 测试用的  // 上线需要注释
+        if( input('user_id')) $this->user_id = input('user_id');// 测试用的  // 上线需要注释
         if(!empty($this->need_login) && in_array(end($path),$this->need_login)) $this->checkLogin();
         !defined("APPNAME") && define('APPNAME',sysconf('app_name'));
         !defined("APPLOGO") && define('APPLOGO',sysconf('app_logo'));
@@ -61,11 +61,11 @@ class Base extends Controller
     {
         $authorization = app()->request->header('Authorization');
         if(empty($authorization) || $authorization == null){
-            /*if($this->is_test == 1) {// 测试用的  // 上线需要注释
+            if($this->is_test == 1) {// 测试用的  // 上线需要注释
                 $this->user_id = input('user_id')  ? input('user_id') : 22;
                 $this->account_id  = $this->user_id;
                 return true;
-            }*/
+            }
             $this->error('Token不存在,拒绝访问--',null,0,-1);
         }
         $key = md5(config('app.jwt'));
@@ -158,7 +158,7 @@ class Base extends Controller
 
     // 验证短信验证码
     protected function checkPhoneCode($phone,$code,$phone_pre = 86){
-        //return true; // 上线需要注释
+        return true; // 上线需要注释
         $sel_time =date('Y-m-d H:i:s',time()-600);
         $store_member_sms = Db::name('store_member_sms')
             ->field('id,code')

+ 2 - 2
application/api/controller/Login.php

@@ -53,8 +53,8 @@ class Login extends Base
             $check_code = $this->checkPhoneCode($account,$code,$phone_pre);
             if(!in_array($account,config('power.phone'))) {
                 // 上线需要去掉注释
-               if(!$check_code) $this->exception('验证码错误');
-               $this->updatePhoneCode($check_code);
+               // if(!$check_code) $this->exception('验证码错误');
+               // $this->updatePhoneCode($check_code);
             }
             $where = [];
             $where[] = $account_type == 1 ? ['email','=',$account] : ['phone','=',$account];