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