浏览代码

环境监测

bill 3 年之前
父节点
当前提交
8a4ce3dd30
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 3 0
      config.js
  2. 5 4
      vite.config.ts

+ 3 - 0
config.js

@@ -0,0 +1,3 @@
+export default {
+  dev: true
+}

+ 5 - 4
vite.config.ts

@@ -1,5 +1,6 @@
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
+import config from './config.js'
 
 import { resolve } from 'path'
 
@@ -44,23 +45,23 @@ export default defineConfig({
         rewrite: path => path.replace(/^\/api/, '')
       },
       '/swkk': {
-        target: 'https://test.4dkankan.com',
+        target: config.dev ? 'https://test.4dkankan.com' : 'https://www.4dkankan.com',
         changeOrigin: true,
         rewrite: path => path.replace(/^\/swkk/, '')
       },
       '/service': {
-        target: 'https://test.4dkankan.com',
+        target: config.dev ? 'https://test.4dkankan.com' : 'https://www.4dkankan.com',
         changeOrigin: true,
       },
 
 
       '/swss': {
-        target: 'https://uat-laser.4dkankan.com/uat',
+        target: config.dev ? 'https://uat-laser.4dkankan.com/uat' : 'https://laser.4dkankan.com',
         changeOrigin: true,
         rewrite: path => path.replace(/^\/swss/, '')
       },
       '/laser': {
-        target: 'https://uat-laser.4dkankan.com',
+        target: config.dev ? 'https://uat-laser.4dkankan.com' : 'https://laser.4dkankan.com',
         changeOrigin: true,
         rewrite: path => path.replace(/^\/swss/, '')
       },