diff --git a/app/common/controller/Frontend.php b/app/common/controller/Frontend.php index 470cf76..e22e159 100644 --- a/app/common/controller/Frontend.php +++ b/app/common/controller/Frontend.php @@ -49,9 +49,11 @@ class Frontend // 初始化会员鉴权实例 $this->auth = Auth::instance(); $token = request()->header('token'); - if ($token && $needLogin) { - if(!$this->auth->init($token)) { - $this->error('Token expiration', [], 401); + if ($token) { + if(request()->controller != 'app\czg\app\controller\LoginController' && request()->action != 'index'){} { + if(!$this->auth->init($token)) { + $this->error('Token expiration', [], 401); + } } }else { if ($needLogin) {