Browse Source

历史轨迹结构

CzRger 1 week ago
parent
commit
1605194aa2
2 changed files with 4 additions and 14 deletions
  1. 3 3
      src/stores/ship-map/ship-map.ts
  2. 1 11
      vite.config.ts

+ 3 - 3
src/stores/ship-map/ship-map.ts

@@ -240,10 +240,10 @@ export const useShipMapStore = defineStore('shipMap', () => {
         ws.onmessage = (e) => {
           try {
             const json = JSON.parse(e.data)
-            if (json.message === '查询结束') {
+            if (json.length === 0) {
               ws.close()
-            } else if (json.data?.length > 0) {
-              state.trackMap.get(feature.get('_id')).history.push(...json.data)
+            } else if (json?.length > 0) {
+              state.trackMap.get(feature.get('_id')).history.push(...json)
               state.trackMap.get(feature.get('_id')).refreshTrackStyle()
             }
           } catch (e) {

+ 1 - 11
vite.config.ts

@@ -57,11 +57,9 @@ export default defineConfig({
         changeOrigin: true,
         rewrite: (path) => {
           return path.replace(/^\/sww-api/, '')
-          // return path
         }
       },
       '/ws-api': {
-        // target: 'ws://8.130.72.63:18073/',
         target: 'ws://192.168.242.21:9099/',
         ws: true,
         changeOrigin: true,
@@ -83,16 +81,8 @@ export default defineConfig({
           return path.replace(/^\/geoserver-api/, '')
         }
       },
-      '/rh-ws-api': {
-        target: 'http://74.10.28.28:6990/', // fk
-        ws: true,
-        changeOrigin: true,
-        rewrite: path => {
-          return path.replace(/^\/rh-ws-api/, '')
-        }
-      },
       '/history-track-ws-api': {
-        target: 'http://74.10.28.24:9999/', // fk
+        target: 'ws://192.168.242.21:9099/', // fk
         ws: true,
         changeOrigin: true,
         rewrite: path => {