Bläddra i källkod

feat():授权

geek 4 år sedan
förälder
incheckning
f14e27c444
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      application/index/BaseController.php

+ 6 - 0
application/index/BaseController.php

@@ -7,6 +7,7 @@ use app\index\exception\ApiException;
 use app\common\until\Token;
 use think\App;
 use think\exception\ValidateException;
+use think\facade\Session;
 use think\Validate;
 
 /**
@@ -70,6 +71,11 @@ abstract class BaseController
 //            $decodeToken = $token->decodeToken();
 //            $this->userId = $decodeToken['userId'];
         }
+        Session::init([
+            'prefix'         => 'module',
+            'type'           => '',
+            'auto_start'     => true,
+        ]);
         // 控制器初始化
         $this->initialize();
     }