path()); $method = $urls[count($urls) - 1]; if (in_array($method, $this->cNoNeedLogin)) return; $session_token = $request->header("session_token"); $responseException = new HttpResponseException(Response::create([ 'code' => 401, 'msg' => "请先登录", 'time' => Request::instance()->server('REQUEST_TIME'), 'data' => null, ], 'json')->header([])); if (is_null($session_token)) throw $responseException; $admin = Admin::where([ "session_token" => $session_token, "status" => \E_MASSAGER_STATUS::Normal ])->find(); if (!$admin) throw $responseException; $this->admin = $admin; } }