1
lzhe
2024-10-21 827ed07c1e51630d9b8eebe446cd653637398901
vue.config.js
@@ -1,8 +1,15 @@
/*
 * @Date: 2024-03-23 09:49:06
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-06 10:17:18
 * @FilePath: /cps-web/vue.config.js
 */
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
   lintOnSave: false,
   //设置为空打包后不分更目录还是多级目录
   publicPath:'',
   publicPath: '',
   //build编译后存放静态文件的目录
   //assetsDir: "static",
@@ -11,17 +18,50 @@
   //开发服务,build后的生产模式还需nginx代理
   devServer: {
        allowedHosts: 'all',
      allowedHosts: 'all',
      open: false, //运行后自动打开浏览器
      port: process.env.VUE_APP_PORT, //挂载端口
      proxy: {
         '/api/smart-collect': {
            target: 'http://120.46.212.231:4102',
            // ws: true,
            changeOrigin: true,
            pathRewrite: {
               '^/api': '/'
            }
         },
         '/api/blade-cps/workstation/listDatapointsByWorkstationId': {
            target: 'http://120.46.212.231:4102',
            // ws: true,
            changeOrigin: true,
            pathRewrite: {
               '^/api': '/'
            }
         },
         '/api/blade-cps/workstation/saveDatapoints': {
            target: 'http://120.46.212.231:4102',
            // ws: true,
            changeOrigin: true,
            pathRewrite: {
               '^/api': '/'
            }
         },
         '/api/blade-cps/workstation/export-dp': {
            target: 'http://120.46.212.231:4102',
            // ws: true,
            changeOrigin: true,
            pathRewrite: {
               '^/api': '/'
            }
         },
         '/api': {
            target: process.env.VUE_APP_API_BASEURL,
            ws: true,
            pathRewrite: {
               '^/api': '/'
               // '^/api': '/'
            }
         }
         },
      }
   },