小编Chr*_*and的帖子

未捕获的异常'Google_Auth_Exception',消息'无法json解码令牌'

我在google-api-client-php库中使用了user-example.php,它正在抛出错误

Fatal error: Uncaught exception 'Google_Auth_Exception' with message 'Could not json       decode the token' in /Applications/XAMPP/xamppfiles/htdocs/Calendar/google-api-php-client/src/Google/Auth/OAuth2.php:174 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/Calendar/google-api-php-client/src/Google/Client.php(196): Google_Auth_OAuth2->setAccessToken('[]') #1 /Applications/XAMPP/xamppfiles/htdocs/calendar/google-api-php-client/examples/user-example.php(80): Google_Client->setAccessToken('[]') #2 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/Calendar/google-api-php-client/src/Google/Auth/OAuth2.php on line 174
Run Code Online (Sandbox Code Playgroud)

示例的代码是

<?php
/*
 * Copyright 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless …
Run Code Online (Sandbox Code Playgroud)

php json google-api google-oauth google-api-php-client

6
推荐指数
2
解决办法
8374
查看次数