getHeaderLine('Authorization'); if (empty($authorization)) { return $this->response->json( $this->apiReturn->error(AdminCode::getMessage(AdminCode::LOGIN_ERROR), AdminCode::LOGIN_ERROR) ); } $authorization = str_replace("Bearer ", "", $authorization); $userJwt = $this->cryptoFactory->cryptoClass('admin-jwt', $authorization)->decrypt(); if (empty($userJwt)) { return $this->response->json( $this->apiReturn->error(AdminCode::getMessage(AdminCode::LOGIN_TOKEN_ERROR), AdminCode::LOGIN_TOKEN_ERROR) ); } //单点登录 // if ($this->userCache->getAdminToken($userJwt['data']->id) != $authorization) { // return $this->response->json( // $this->apiReturn->error(AdminCode::getMessage(AdminCode::LOGIN_TOKEN_ERROR), AdminCode::LOGIN_TOKEN_ERROR) // ); // } Context::set('admin_id',$userJwt['data']->id); Context::set('role_id',$userJwt['data']->role); return $handler->handle($request); } }