修改huancun

This commit is contained in:
2023-05-15 17:59:15 +08:00
parent 95a14c5a59
commit fa9461bced
3 changed files with 19 additions and 3 deletions
+3 -1
View File
@@ -4,10 +4,12 @@ namespace Extend\Wechat;
use App\Constants\HttpEnumCode;
use App\Exception\BusinessException;
use App\Factory\CacheFactory;
use EasyWeChat\Kernel\Exceptions\BadResponseException;
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
use EasyWeChat\Kernel\HttpClient\AccessTokenAwareClient;
use EasyWeChat\MiniApp\Application;
use Hyperf\Cache\Cache;
use Hyperf\Utils\ApplicationContext;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
@@ -83,7 +85,7 @@ class Wechat
$this->app = new Application($config);
// 替换缓存
$this->app->setCache(ApplicationContext::getContainer()->get(CacheInterface::class));
$this->app->setCache(make(Cache::class,['driver' => 'prod']));
} catch (InvalidArgumentException $e) {
throw new BusinessException('实例化EasyWeChat类失败:' . $e->getMessage(), HttpEnumCode::SERVER_ERROR);