diff --git a/app/common/controller/ImController.php b/app/common/controller/ImController.php index 1fd72668d..a9a9161c3 100644 --- a/app/common/controller/ImController.php +++ b/app/common/controller/ImController.php @@ -8,12 +8,19 @@ use app\common\model\Company; use app\common\model\im\UserImMessage; use app\common\model\user\User; use GatewayClient\Gateway; +use think\App; use think\facade\Db; use think\response\Json; class ImController extends BaseLikeAdminController { - //获取场景值 + public function __construct(App $app) + { + parent::__construct($app); + Gateway::$registerAddress = "172.19.97.179:1236"; + } + + //获取场景值 private function sceneText($scene): string { if($scene == 0){ diff --git a/extend/workerim/start_gateway.php b/extend/workerim/start_gateway.php index 1840cedf7..6dd9ce80a 100644 --- a/extend/workerim/start_gateway.php +++ b/extend/workerim/start_gateway.php @@ -23,7 +23,7 @@ $gateway->lanIp = '172.19.97.179'; $gateway->startPort = 3900; // 服务注册地址 -$gateway->registerAddress = '172.19.97.179:1236'; +$gateway->registerAddress = '127.0.0.1:1236'; // 心跳间隔 $gateway->pingInterval = 20;