Commit 99714edbdc8520db7eafb7e11d8636ffec6b429b
Merge branch 'ww' into 'main'
perf: 优化组态中心访问地址 See merge request huang/yun-teng-iot-front!221
Showing
3 changed files
with
22 additions
and
8 deletions
@@ -13,10 +13,12 @@ VITE_PUBLIC_PATH = / | @@ -13,10 +13,12 @@ VITE_PUBLIC_PATH = / | ||
13 | # 线上演示环境 | 13 | # 线上演示环境 |
14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] | 14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] |
15 | # 线上测试环境 | 15 | # 线上测试环境 |
16 | -VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] | 16 | +# VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] |
17 | +VITE_PROXY = [["/api","https://dev.thingskit.com/api"],["/thingskit-drawio","http://localhost:3000/"]] | ||
17 | 18 | ||
18 | # 实时数据的ws地址 | 19 | # 实时数据的ws地址 |
19 | -VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= | 20 | +# VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= |
21 | +VITE_WEB_SOCKET = ws://44.99.141.212:8080/api/ws/plugins/telemetry?token= | ||
20 | 22 | ||
21 | # Delete console | 23 | # Delete console |
22 | VITE_DROP_CONSOLE = true | 24 | VITE_DROP_CONSOLE = true |
@@ -32,3 +34,4 @@ VITE_GLOB_API_URL_PREFIX=/yt | @@ -32,3 +34,4 @@ VITE_GLOB_API_URL_PREFIX=/yt | ||
32 | 34 | ||
33 | #configuration | 35 | #configuration |
34 | VITE_GLOB_CONFIGURATION = /thingskit-drawio | 36 | VITE_GLOB_CONFIGURATION = /thingskit-drawio |
37 | + |
@@ -16,11 +16,13 @@ VITE_BUILD_COMPRESS = 'gzip' | @@ -16,11 +16,13 @@ VITE_BUILD_COMPRESS = 'gzip' | ||
16 | VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false | 16 | VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false |
17 | 17 | ||
18 | # Basic interface address SPA | 18 | # Basic interface address SPA |
19 | -VITE_GLOB_API_URL=http://47.99.141.212:8080/api | 19 | +# VITE_GLOB_API_URL=http://47.99.141.212:8080/api |
20 | +VITE_GLOB_API_URL=https://dev.thingskit.com/api | ||
20 | 21 | ||
21 | # File upload address, optional | 22 | # File upload address, optional |
22 | # It can be forwarded by nginx or write the actual address directly | 23 | # It can be forwarded by nginx or write the actual address directly |
23 | -VITE_GLOB_UPLOAD_URL=http://47.99.141.212:8080/api/yt/oss/upload | 24 | +# VITE_GLOB_UPLOAD_URL=http://47.99.141.212:8080/api/yt/oss/upload |
25 | +VITE_GLOB_UPLOAD_URL=https://dev.thingskit.com/api/yt/oss/upload | ||
24 | 26 | ||
25 | # Interface prefix | 27 | # Interface prefix |
26 | VITE_GLOB_API_URL_PREFIX=/yt | 28 | VITE_GLOB_API_URL_PREFIX=/yt |
@@ -35,7 +37,9 @@ VITE_USE_PWA = false | @@ -35,7 +37,9 @@ VITE_USE_PWA = false | ||
35 | VITE_LEGACY = true | 37 | VITE_LEGACY = true |
36 | 38 | ||
37 | # 实时数据的ws地址 | 39 | # 实时数据的ws地址 |
38 | -VITE_WEB_SOCKET = ws://47.99.141.212:8080/api/ws/plugins/telemetry?token= | 40 | +VITE_WEB_SOCKET = wss://dev.thingskit.com/api/ws/plugins/telemetry?token= |
41 | +# VITE_WEB_SOCKET = ws://47.99.141.212:8080/api/ws/plugins/telemetry?token= | ||
39 | 42 | ||
40 | #configuration | 43 | #configuration |
41 | VITE_GLOB_CONFIGURATION = http://localhost:3000 | 44 | VITE_GLOB_CONFIGURATION = http://localhost:3000 |
45 | + |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | } from '/@/api/configuration/center/configurationCenter'; | 81 | } from '/@/api/configuration/center/configurationCenter'; |
82 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 82 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
83 | 83 | ||
84 | - import { getAppEnvConfig } from '/@/utils/env'; | 84 | + import { getAppEnvConfig, isDevMode } from '/@/utils/env'; |
85 | import { Authority } from '/@/components/Authority'; | 85 | import { Authority } from '/@/components/Authority'; |
86 | 86 | ||
87 | export default defineComponent({ | 87 | export default defineComponent({ |
@@ -95,6 +95,7 @@ | @@ -95,6 +95,7 @@ | ||
95 | }, | 95 | }, |
96 | setup() { | 96 | setup() { |
97 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); | 97 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); |
98 | + const isDev = isDevMode(); | ||
98 | const searchInfo = reactive<Recordable>({}); | 99 | const searchInfo = reactive<Recordable>({}); |
99 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 100 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); |
100 | // 表格hooks | 101 | // 表格hooks |
@@ -157,10 +158,16 @@ | @@ -157,10 +158,16 @@ | ||
157 | }; | 158 | }; |
158 | 159 | ||
159 | const handlePreview = (record: Recordable | null) => { | 160 | const handlePreview = (record: Recordable | null) => { |
160 | - window.open(`${VITE_GLOB_CONFIGURATION}/?dev=1&configurationId=${record!.id}&lightbox=1`); | 161 | + window.open( |
162 | + `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${ | ||
163 | + record!.id | ||
164 | + }&lightbox=1` | ||
165 | + ); | ||
161 | }; | 166 | }; |
162 | const handleDesign = (record: Recordable | null) => { | 167 | const handleDesign = (record: Recordable | null) => { |
163 | - window.open(VITE_GLOB_CONFIGURATION + '/?dev=1&configurationId=' + record!.id, '_blank'); | 168 | + window.open( |
169 | + `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${record!.id}` | ||
170 | + ); | ||
164 | }; | 171 | }; |
165 | return { | 172 | return { |
166 | searchInfo, | 173 | searchInfo, |