has($cache_key)) { $oauth_discovery = cache()->get($cache_key); } else { // lock 防止重复请求 $oauth_discovery = cache()->remember($cache_key, 3600, function () use ($http) { $response = $http->get(config('oauth.discovery')); return json_decode($response->getBody(), true); }); } $this->auth_url = $oauth_discovery['authorization_endpoint']; $this->token_url = $oauth_discovery['token_endpoint']; $this->user_url = $oauth_discovery['userinfo_endpoint']; $this->jwks_url = $oauth_discovery['jwks_uri']; $cache_key = 'oauth_discovery_jwks'; if (cache()->has($cache_key)) { $this->jwks = cache()->get($cache_key); } else { $this->jwks = cache()->remember($cache_key, 3600, function () use ($http) { $response = $http->get($this->jwks_url); return json_decode($response->getBody(), true); }); } } }