From f475aa4656b85e120171d5184d7c62dfa19e12ba Mon Sep 17 00:00:00 2001 From: SunTao <328867980@qq.com> Date: Tue, 17 Dec 2024 14:24:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E9=A2=84=E8=AD=A6=E4=B8=AD?= =?UTF-8?q?=E5=BF=83-=E5=9B=BE=E4=BE=8B=E8=AE=BE=E7=BD=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 29 ++- src/main.js | 9 +- .../warning-line/components/edit-line.vue | 185 ++++++++++++++++++ .../xj/inspection-warn/warning-line/index.vue | 140 +++++++++++++ .../warning-setup/components/add-setup.vue | 48 +++-- .../inspection-warn/warning-setup/index.vue | 32 +-- .../components/image-dialog.vue | 10 +- 7 files changed, 412 insertions(+), 41 deletions(-) create mode 100644 src/views/xj/inspection-warn/warning-line/components/edit-line.vue create mode 100644 src/views/xj/inspection-warn/warning-line/index.vue diff --git a/nginx.conf b/nginx.conf index b291b0f..b2b54f6 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,7 +1,31 @@ - +http { server { - listen 80; + listen 80; + server_name localhost; + charset utf-8; + + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + index index.html index.htm; + } + + location /prod-api/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://192.168.50.208:8080/; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + }, + server { + listen 8082; server_name localhost; charset utf-8; @@ -24,4 +48,5 @@ root html; } } +} diff --git a/src/main.js b/src/main.js index 7fe0624..658b98e 100644 --- a/src/main.js +++ b/src/main.js @@ -104,8 +104,15 @@ store.watch( () => store.getters.token, (newToken) => { if (newToken) { + if (window.location.port === ""||window.location.port === 80) { + // 内网 + wsService.connect(`ws://${window.location.hostname}:8080/websocket?token=${newToken}`); + }else{ + // 外网 + wsService.connect(`ws://${window.location.hostname}:18080/websocket?tsoken=${newToken}`); + } // 本地 - wsService.connect(`ws://localhost:8080/websocket?token=${newToken}`); + // wsService.connect(`ws://localhost:8080/websocket?token=${newToken}`); // 内网 // wsService.connect(`ws://10.60.5.83:8080/websocket?token=${newToken}`); // 外网 diff --git a/src/views/xj/inspection-warn/warning-line/components/edit-line.vue b/src/views/xj/inspection-warn/warning-line/components/edit-line.vue new file mode 100644 index 0000000..3e10b36 --- /dev/null +++ b/src/views/xj/inspection-warn/warning-line/components/edit-line.vue @@ -0,0 +1,185 @@ + + + + + + diff --git a/src/views/xj/inspection-warn/warning-line/index.vue b/src/views/xj/inspection-warn/warning-line/index.vue new file mode 100644 index 0000000..c1f9359 --- /dev/null +++ b/src/views/xj/inspection-warn/warning-line/index.vue @@ -0,0 +1,140 @@ + + + + + + diff --git a/src/views/xj/inspection-warn/warning-setup/components/add-setup.vue b/src/views/xj/inspection-warn/warning-setup/components/add-setup.vue index a923eff..270d757 100644 --- a/src/views/xj/inspection-warn/warning-setup/components/add-setup.vue +++ b/src/views/xj/inspection-warn/warning-setup/components/add-setup.vue @@ -2,34 +2,60 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-01-08 11:56:02 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-12-02 15:37:29 + * @LastEditTime: 2024-12-17 13:44:44 * @FilePath: \znxjxt-ui\src\views\xj\inspection-warn\warning-setup\components\add-setup.vue * @Description: 预警中心-预警设置-新增/编辑组件 --> - -
- - -