config = Config::get('swdz.goodle'); $this->client = new Client([ 'client_id' => $this->config['client_id'], 'client_secret' => $this->config['client_secret'], 'redirect_uri' => $this->config['redirect_uri'], 'scopes' => $this->config['scopes'] ]); } /** * APP通过code换取用户信息 * * @return array|false * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ public function appAuth(){ $code = request()->get('code', null); return $this->client->verifyIdToken($code); } /** * WEB打开授权页面(待补充) * * @return void */ public static function webAuth(){ } }