isLogin()) { // return $this->redirect(url('login/index'), 302); // } } /** * 判断是否登录 * @return bool */ public function isLogin() { $this->adminUser = session(config('admin.session_admin')); if (empty($this->adminUser)) { return false; } return true; } public function redirect(...$args) { throw new HttpResponseException(redirect(...$args)); } }