From f395e63b8e8814f11db34dd1fb969fa3c81a2536 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Tue, 24 Oct 2023 15:05:38 +0800 Subject: [PATCH] 1 --- extend/Wechat/Wechat.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 [];