From 8fad61322103f6aa4b8657b2bb48be79a1f6ec52 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 05 二月 2024 17:36:53 +0800
Subject: [PATCH] 修改配置文件.2

---
 public/config/config.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/public/config/config.js b/public/config/config.js
index d22237e..5b883ab 100644
--- a/public/config/config.js
+++ b/public/config/config.js
@@ -1,12 +1,19 @@
+var isLocal = false;
+
 var is_production = false; // 鏄惁涓虹敓浜х幆澧�
 
 var menuStartName = "绠¢亾鍩虹澶ф暟鎹钩鍙�";
 
-var isWeb = location.hostname.indexOf("192.") == -1; // 106.120.22.35
+var isWeb = location.hostname.indexOf("106.") == 0; // 106.120.22.35
 
 var host = location.protocol + "//" + location.hostname; // http://192.168.20.205
 
 var webHost = location.origin; // http://192.168.20.205:8088
+
+if (isLocal) {
+  host = "http://192.168.20.205";
+  webHost = host + ":8088";
+}
 
 var iisHost = host + (isWeb ? ":8050" : ":80"); // http://192.168.20.205:80
 
@@ -21,7 +28,7 @@
 var geoServerURl = webHost + '/geoserver/LF/wms';
 
 // WebSocket
-var socketUrl = 'ws://' + location.host + '/server/ws/select'; // 192.168.20.205:8088
+var socketUrl = 'ws://' + webHost.split("//")[1] + '/server/ws/select'; // 192.168.20.205:8088
 
 var geoserverWFS = '/geoserver/LF/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=LF%3Abs_project&maxFeatures=50&outputFormat=application%2Fjson&cql_filter=projname=';
 

--
Gitblit v1.9.3