修改huancun

This commit is contained in:
wucongxing 2023-05-15 17:59:15 +08:00
parent 95a14c5a59
commit fa9461bced
3 changed files with 19 additions and 3 deletions

View File

@ -41,7 +41,9 @@ use Extend\Kuaidi100\Kuaidi;
use Extend\Prescription\Prescription;
use Extend\RegulatoryPlatform\regulatoryPlatform;
use Extend\TencentIm\RecentContact;
use Extend\Wechat\Wechat;
use Hyperf\Amqp\Producer;
use Hyperf\Cache\Cache;
use Hyperf\DbConnection\Db;
use Hyperf\Redis\Redis;
use Hyperf\Utils\ApplicationContext;
@ -329,7 +331,5 @@ class TestController extends AbstractController
}
public function test_15(){
$a = Mask::maskNameStr("gdxz123400000",2);
dump($a);
}
}

View File

@ -24,4 +24,18 @@ return [
'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
],
],
'prod' => [
'host' => "139.155.127.177",
'auth' => "gdxz2022t&dj.d",
'port' => 6379,
'db' => (int) env('REDIS_DB', 0),
'pool' => [
'min_connections' => 1,
'max_connections' => 10,
'connect_timeout' => 10.0,
'wait_timeout' => 3.0,
'heartbeat' => -1,
'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
],
],
];

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);