This commit is contained in:
2025-08-15 17:56:38 +08:00
parent 2bb2c6dd16
commit 2acf97fb98

View File

@@ -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) {