gaoshp
2024-11-10 5d0a077b235fa694bd356b94edbba7c2f483d36a
vue.config.js
@@ -1,8 +1,15 @@
/*
 * @Date: 2024-03-23 09:49:06
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-11-03 20:06:33
 * @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/smis/workstation/listDatapointsByWorkstationId': {
         //    target: 'http://120.46.212.231:4102',
         //    // ws: true,
         //    changeOrigin: true,
         //    pathRewrite: {
         //       '^/api': '/'
         //    }
         // },
         '/api/smis/workstation/saveDatapoints': {
            target: 'http://120.46.212.231:4102',
            // ws: true,
            changeOrigin: true,
            pathRewrite: {
               '^/api': '/'
            }
         },
         '/api/smis/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': '/'
            }
         }
         },
      }
   },