gaoshp
2025-11-04 86dc31488d94eac147c0a6b4423a210d1ab9ce31
vue.config.js
@@ -1,7 +1,7 @@
/*
 * @Date: 2024-03-23 09:49:06
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-11-03 20:06:33
 * @LastEditTime: 2025-11-04 22:19:58
 * @FilePath: /cps-web/vue.config.js
 */
const { defineConfig } = require('@vue/cli-service')
@@ -18,28 +18,31 @@
   //开发服务,build后的生产模式还需nginx代理
   devServer: {
      client: {
         overlay: false
      },
      allowedHosts: 'all',
      open: false, //运行后自动打开浏览器
      port: process.env.VUE_APP_PORT, //挂载端口
      proxy: {
         '/api/smart-collect': {
            target: 'http://120.46.212.231:4102',
            target: 'http://120.46.212.231:5102',
            // ws: true,
            changeOrigin: true,
            pathRewrite: {
               '^/api': '/'
            }
         },
         // '/api/smis/workstation/listDatapointsByWorkstationId': {
         //    target: 'http://120.46.212.231:4102',
         //    // 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:4102',
            target: 'http://120.46.212.231:5102',
            // ws: true,
            changeOrigin: true,
            pathRewrite: {
@@ -47,7 +50,7 @@
            }
         },
         '/api/smis/workstation/export-dp': {
            target: 'http://120.46.212.231:4102',
            target: 'http://120.46.212.231:5102',
            // ws: true,
            changeOrigin: true,
            pathRewrite: {
@@ -55,10 +58,11 @@
            }
         },
         '/api': {
            // target: 'http://localhost:4102',
            target: process.env.VUE_APP_API_BASEURL,
            ws: true,
            pathRewrite: {
               // '^/api': '/'
                '^/api': '/api'
            }
         },