Răsfoiți Sursa

视频安防监控

bzd_lxf 1 lună în urmă
părinte
comite
c6b02e8abe
3 a modificat fișierele cu 12 adăugiri și 2 ștergeri
  1. 6 0
      pm_ui/.env.development
  2. 3 0
      pm_ui/.env.production
  3. 3 2
      pm_ui/vite.config.js

+ 6 - 0
pm_ui/.env.development

@@ -6,3 +6,9 @@ VITE_APP_ENV = 'development'
 
 # IBMS管理系统/开发环境
 VITE_APP_BASE_API = '/dev-api'
+
+# websocket 路径
+VITE_WS_URL=182.43.195.17
+
+# 接口路径和端口
+VITE_API_URL=10.1.1.165:8000

+ 3 - 0
pm_ui/.env.production

@@ -12,3 +12,6 @@ VITE_BUILD_COMPRESS = gzip
 
 # websocket 路径
 VITE_WS_URL=182.43.195.17
+
+# 接口路径和端口
+VITE_API_URL=http://10.1.1.165:8000

+ 3 - 2
pm_ui/vite.config.js

@@ -7,7 +7,7 @@ import { ip } from 'address'
 // https://vitejs.dev/config/
 export default defineConfig(({ mode, command }) => {
   const env = loadEnv(mode, process.cwd())
-  const { VITE_APP_ENV,VITE_WS_URL } = env
+  const { VITE_APP_ENV,VITE_WS_URL, VITE_API_URL } = env
 
   // 获取本机局域网 IP 地址
   const localIP = ip()
@@ -18,7 +18,8 @@ export default defineConfig(({ mode, command }) => {
     base: VITE_APP_ENV === 'production' ? '/' : '/',
     plugins: createVitePlugins(env, command === 'build'),
     define: {
-      __LOCAL_IP__: JSON.stringify(VITE_APP_ENV === 'production' ? `ws://${VITE_WS_URL}:8010/ws` : 'ws://localhost:8010/ws')
+      __LOCAL_IP__: JSON.stringify(VITE_APP_ENV === 'production' ? `ws://${VITE_WS_URL}:8010/ws` : 'ws://localhost:8010/ws'),
+      __LOCAL_API__: JSON.stringify(VITE_API_URL)
     },
     resolve: {
       // https://cn.vitejs.dev/config/#resolve-alias