diff --git a/extend/Wechat/Wechat.php b/extend/Wechat/Wechat.php index 1ee160e..5b46485 100644 --- a/extend/Wechat/Wechat.php +++ b/extend/Wechat/Wechat.php @@ -12,7 +12,7 @@ use EasyWeChat\Kernel\HttpClient\AccessTokenAwareClient; use EasyWeChat\MiniApp\Application; use Hyperf\Cache\Cache; use Hyperf\Redis\Redis; -use Hyperf\Utils\ApplicationContext; +//use Hyperf\Utils\ApplicationContext; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Psr\SimpleCache\CacheInterface; @@ -21,6 +21,7 @@ use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface; use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface; use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface; use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface; +use Hyperf\Context\ApplicationContext; /** * 微信类 @@ -87,7 +88,7 @@ class Wechat $this->app = new Application($config); // 替换缓存 - $this->app->setCache(ApplicationContext::getContainer()->get(CacheFactory::class)); + $this->app->setCache(ApplicationContext::getContainer()->get(CacheInterface::class)); } catch (InvalidArgumentException $e) { throw new BusinessException('实例化EasyWeChat类失败:' . $e->getMessage(), HttpEnumCode::SERVER_ERROR); @@ -244,6 +245,7 @@ class Wechat if ($response->isFailed()) { // 出错了,处理异常 $result = $response->toArray(); + dump($result); if(empty($result)){ // 返回值为空 return [];