Showing
5 changed files
with
11 additions
and
15 deletions
@@ -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,10 +37,9 @@ VITE_USE_PWA = false | @@ -35,10 +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 |
42 | 45 | ||
43 | -#是否是测试环境 | ||
44 | -VITE_IS_DEV = false |
@@ -29,7 +29,6 @@ export function getAppEnvConfig() { | @@ -29,7 +29,6 @@ export function getAppEnvConfig() { | ||
29 | VITE_GLOB_API_URL_PREFIX, | 29 | VITE_GLOB_API_URL_PREFIX, |
30 | VITE_GLOB_UPLOAD_URL, | 30 | VITE_GLOB_UPLOAD_URL, |
31 | VITE_GLOB_CONFIGURATION, | 31 | VITE_GLOB_CONFIGURATION, |
32 | - VITE_IS_DEV, | ||
33 | } = ENV; | 32 | } = ENV; |
34 | 33 | ||
35 | if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { | 34 | if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { |
@@ -45,7 +44,6 @@ export function getAppEnvConfig() { | @@ -45,7 +44,6 @@ export function getAppEnvConfig() { | ||
45 | VITE_GLOB_API_URL_PREFIX, | 44 | VITE_GLOB_API_URL_PREFIX, |
46 | VITE_GLOB_UPLOAD_URL, | 45 | VITE_GLOB_UPLOAD_URL, |
47 | VITE_GLOB_CONFIGURATION, | 46 | VITE_GLOB_CONFIGURATION, |
48 | - VITE_IS_DEV: JSON.parse(VITE_IS_DEV), | ||
49 | }; | 47 | }; |
50 | } | 48 | } |
51 | 49 |
@@ -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({ |
@@ -94,7 +94,8 @@ | @@ -94,7 +94,8 @@ | ||
94 | Authority, | 94 | Authority, |
95 | }, | 95 | }, |
96 | setup() { | 96 | setup() { |
97 | - const { VITE_GLOB_CONFIGURATION, VITE_IS_DEV } = 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 |
@@ -158,14 +159,14 @@ | @@ -158,14 +159,14 @@ | ||
158 | 159 | ||
159 | const handlePreview = (record: Recordable | null) => { | 160 | const handlePreview = (record: Recordable | null) => { |
160 | window.open( | 161 | window.open( |
161 | - `${VITE_GLOB_CONFIGURATION}/${VITE_IS_DEV ? '?dev=1&' : '?'}configurationId=${ | 162 | + `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${ |
162 | record!.id | 163 | record!.id |
163 | }&lightbox=1` | 164 | }&lightbox=1` |
164 | ); | 165 | ); |
165 | }; | 166 | }; |
166 | const handleDesign = (record: Recordable | null) => { | 167 | const handleDesign = (record: Recordable | null) => { |
167 | window.open( | 168 | window.open( |
168 | - `${VITE_GLOB_CONFIGURATION}/${VITE_IS_DEV ? '?dev=1&' : '?'}configurationId=${record!.id}` | 169 | + `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${record!.id}` |
169 | ); | 170 | ); |
170 | }; | 171 | }; |
171 | return { | 172 | return { |
@@ -160,6 +160,4 @@ export interface GlobEnvConfig { | @@ -160,6 +160,4 @@ export interface GlobEnvConfig { | ||
160 | VITE_GLOB_UPLOAD_URL?: string; | 160 | VITE_GLOB_UPLOAD_URL?: string; |
161 | //configuration | 161 | //configuration |
162 | VITE_GLOB_CONFIGURATION: string; | 162 | VITE_GLOB_CONFIGURATION: string; |
163 | - // is dev | ||
164 | - VITE_IS_DEV: string; | ||
165 | } | 163 | } |