Commit 4d9e2878c537637c3de31d4b3d5b45596216c96c

Authored by ww
1 parent 7e084bd9

perf: delete useless env varible

... ... @@ -35,5 +35,3 @@ VITE_GLOB_API_URL_PREFIX=/yt
35 35 #configuration
36 36 VITE_GLOB_CONFIGURATION = /thingskit-drawio
37 37
38   -#是否是测试环境
39   -VITE_IS_DEV = true
... ...
... ... @@ -16,11 +16,13 @@ VITE_BUILD_COMPRESS = 'gzip'
16 16 VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
17 17
18 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 22 # File upload address, optional
22 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 27 # Interface prefix
26 28 VITE_GLOB_API_URL_PREFIX=/yt
... ... @@ -35,10 +37,9 @@ VITE_USE_PWA = false
35 37 VITE_LEGACY = true
36 38
37 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 43 #configuration
41 44 VITE_GLOB_CONFIGURATION = http://localhost:3000
42 45
43   -#是否是测试环境
44   -VITE_IS_DEV = false
... ...
... ... @@ -29,7 +29,6 @@ export function getAppEnvConfig() {
29 29 VITE_GLOB_API_URL_PREFIX,
30 30 VITE_GLOB_UPLOAD_URL,
31 31 VITE_GLOB_CONFIGURATION,
32   - VITE_IS_DEV,
33 32 } = ENV;
34 33
35 34 if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
... ... @@ -45,7 +44,6 @@ export function getAppEnvConfig() {
45 44 VITE_GLOB_API_URL_PREFIX,
46 45 VITE_GLOB_UPLOAD_URL,
47 46 VITE_GLOB_CONFIGURATION,
48   - VITE_IS_DEV: JSON.parse(VITE_IS_DEV),
49 47 };
50 48 }
51 49
... ...
... ... @@ -81,7 +81,7 @@
81 81 } from '/@/api/configuration/center/configurationCenter';
82 82 import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
83 83
84   - import { getAppEnvConfig } from '/@/utils/env';
  84 + import { getAppEnvConfig, isDevMode } from '/@/utils/env';
85 85 import { Authority } from '/@/components/Authority';
86 86
87 87 export default defineComponent({
... ... @@ -94,7 +94,8 @@
94 94 Authority,
95 95 },
96 96 setup() {
97   - const { VITE_GLOB_CONFIGURATION, VITE_IS_DEV } = getAppEnvConfig();
  97 + const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig();
  98 + const isDev = isDevMode();
98 99 const searchInfo = reactive<Recordable>({});
99 100 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
100 101 // 表格hooks
... ... @@ -158,14 +159,14 @@
158 159
159 160 const handlePreview = (record: Recordable | null) => {
160 161 window.open(
161   - `${VITE_GLOB_CONFIGURATION}/${VITE_IS_DEV ? '?dev=1&' : '?'}configurationId=${
  162 + `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${
162 163 record!.id
163 164 }&lightbox=1`
164 165 );
165 166 };
166 167 const handleDesign = (record: Recordable | null) => {
167 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 172 return {
... ...
... ... @@ -160,6 +160,4 @@ export interface GlobEnvConfig {
160 160 VITE_GLOB_UPLOAD_URL?: string;
161 161 //configuration
162 162 VITE_GLOB_CONFIGURATION: string;
163   - // is dev
164   - VITE_IS_DEV: string;
165 163 }
... ...