cxs 4 dni temu
rodzic
commit
21cef27559
3 zmienionych plików z 10 dodań i 8 usunięć
  1. 3 0
      .env.development
  2. 3 0
      .env.production
  3. 4 8
      src/views/alarm/gis/index.vue

+ 3 - 0
.env.development

@@ -17,6 +17,9 @@ VITE_PWA = false
 # 开发环境接口地址
 VITE_API_URL = /api
 
+# 开发环境GIS地址
+VITE_API_GIS_URL = "http://192.168.43.77:8080"
+
 # 开发环境跨域代理,支持配置多个
 VITE_PROXY = [["/api","http://192.168.43.77:18088"]]
 # VITE_PROXY = [["/api","http://192.168.127.123:18088"]]

+ 3 - 0
.env.production

@@ -23,3 +23,6 @@ VITE_PWA = true
 
 # 线上环境接口地址
 VITE_API_URL = /api
+
+# 开发环境GIS地址
+VITE_API_GIS_URL = /gis-api

+ 4 - 8
src/views/alarm/gis/index.vue

@@ -363,12 +363,8 @@
 
 
 
-  // const isStationCode = ref()
-
-
-
-
 
+  // const isStationCode = ref()
 
 // 时间选择器、滑块和时间间隔的控制变量
 const value2 = ref(0); // 滑动条的默认值(从0点开始)
@@ -749,7 +745,7 @@ const info=ref<any>({
 const createWMSLayer = ({ layerName, minZoom, maxZoom, opacity = 1 }) => {
   return new TileLayer({
     source: new TileWMS({
-      url: 'http://192.168.127.124:8080/geoserver/wms',
+      url: import.meta.env.VITE_API_GIS_URL as string+'/geoserver/wms',
       params: { 'LAYERS': layerName, 'TILED': true, 'FORMAT': 'image/png', 'TRANSPARENT': true, 'ENCODING': 'UTF-8' },
       serverType: 'geoserver'
     }),
@@ -788,7 +784,7 @@ const initializeMap = () => {
   // 定义鹰眼视图层
   const overviewMapLayer = new TileLayer({
     source: new TileWMS({
-      url: 'http://192.168.127.124:8080/geoserver/wms',
+      url: import.meta.env.VITE_API_GIS_URL as string+'/geoserver/wms',
       params: {
         'LAYERS': 'basemap:province',  // 选择可见的图层为省级
         'TILED': true,
@@ -823,7 +819,7 @@ watch(isEagleEyeOn, (newValue) => {
 const initializeOverviewMap = () => {
   const overviewMapLayer = new TileLayer({
     source: new TileWMS({
-      url: 'http://192.168.127.124:8080/geoserver/wms',
+      url: import.meta.env.VITE_API_GIS_URL as string+'/geoserver/wms',
       params: {
         'LAYERS': 'basemap:province',
         'TILED': true,