Ver código fonte

refactor: 优化 publicPath 变量定义,调整 API 代理目标地址

xieyong 1 semana atrás
pai
commit
7fd8586229
1 arquivos alterados com 5 adições e 3 exclusões
  1. 5 3
      vue.config.js

+ 5 - 3
vue.config.js

@@ -7,8 +7,10 @@ function resolve(dir) {
   return path.join(__dirname, dir);
 }
 
+const publicPath = '/ehs';
+
 module.exports = {
-  publicPath: '/ehs',
+  publicPath,
   lintOnSave: false,
   outputDir: 'dist',
   productionSourceMap: false,
@@ -51,8 +53,8 @@ module.exports = {
         // target: 'http://192.168.1.251:18186', //测试
         // target: 'http://192.168.1.23:18086',//罗
         // target: 'http://192.168.1.144:18086',//付
-        // target: 'http://192.168.1.102:18086',
-        target: 'http://aiot.zoomwin.com.cn:51001/api',
+        target: 'http://192.168.1.102:18086',
+        // target: 'http://aiot.zoomwin.com.cn:51001/api',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''