修改huancun
This commit is contained in:
parent
95a14c5a59
commit
fa9461bced
@ -41,7 +41,9 @@ use Extend\Kuaidi100\Kuaidi;
|
|||||||
use Extend\Prescription\Prescription;
|
use Extend\Prescription\Prescription;
|
||||||
use Extend\RegulatoryPlatform\regulatoryPlatform;
|
use Extend\RegulatoryPlatform\regulatoryPlatform;
|
||||||
use Extend\TencentIm\RecentContact;
|
use Extend\TencentIm\RecentContact;
|
||||||
|
use Extend\Wechat\Wechat;
|
||||||
use Hyperf\Amqp\Producer;
|
use Hyperf\Amqp\Producer;
|
||||||
|
use Hyperf\Cache\Cache;
|
||||||
use Hyperf\DbConnection\Db;
|
use Hyperf\DbConnection\Db;
|
||||||
use Hyperf\Redis\Redis;
|
use Hyperf\Redis\Redis;
|
||||||
use Hyperf\Utils\ApplicationContext;
|
use Hyperf\Utils\ApplicationContext;
|
||||||
@ -329,7 +331,5 @@ class TestController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function test_15(){
|
public function test_15(){
|
||||||
$a = Mask::maskNameStr("gdxz123400000",2);
|
|
||||||
dump($a);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -24,4 +24,18 @@ return [
|
|||||||
'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
|
'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),
|
||||||
|
],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -4,10 +4,12 @@ namespace Extend\Wechat;
|
|||||||
|
|
||||||
use App\Constants\HttpEnumCode;
|
use App\Constants\HttpEnumCode;
|
||||||
use App\Exception\BusinessException;
|
use App\Exception\BusinessException;
|
||||||
|
use App\Factory\CacheFactory;
|
||||||
use EasyWeChat\Kernel\Exceptions\BadResponseException;
|
use EasyWeChat\Kernel\Exceptions\BadResponseException;
|
||||||
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
|
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
|
||||||
use EasyWeChat\Kernel\HttpClient\AccessTokenAwareClient;
|
use EasyWeChat\Kernel\HttpClient\AccessTokenAwareClient;
|
||||||
use EasyWeChat\MiniApp\Application;
|
use EasyWeChat\MiniApp\Application;
|
||||||
|
use Hyperf\Cache\Cache;
|
||||||
use Hyperf\Utils\ApplicationContext;
|
use Hyperf\Utils\ApplicationContext;
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
@ -83,7 +85,7 @@ class Wechat
|
|||||||
$this->app = new Application($config);
|
$this->app = new Application($config);
|
||||||
|
|
||||||
// 替换缓存
|
// 替换缓存
|
||||||
$this->app->setCache(ApplicationContext::getContainer()->get(CacheInterface::class));
|
$this->app->setCache(make(Cache::class,['driver' => 'prod']));
|
||||||
|
|
||||||
} catch (InvalidArgumentException $e) {
|
} catch (InvalidArgumentException $e) {
|
||||||
throw new BusinessException('实例化EasyWeChat类失败:' . $e->getMessage(), HttpEnumCode::SERVER_ERROR);
|
throw new BusinessException('实例化EasyWeChat类失败:' . $e->getMessage(), HttpEnumCode::SERVER_ERROR);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user