1
lzhe
2024-10-10 6b467188a7175e0f5bdb4bb25da5a8ee064d2b4c
vue.config.js
@@ -1,7 +1,7 @@
/*
 * @Date: 2024-03-23 09:49:06
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-03-28 11:34:07
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-06 10:17:18
 * @FilePath: /cps-web/vue.config.js
 */
const { defineConfig } = require('@vue/cli-service')
@@ -9,7 +9,7 @@
module.exports = defineConfig({
   lintOnSave: false,
   //设置为空打包后不分更目录还是多级目录
   publicPath:'',
   publicPath: '',
   //build编译后存放静态文件的目录
   //assetsDir: "static",
@@ -18,10 +18,42 @@
   //开发服务,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,
@@ -29,13 +61,7 @@
               // '^/api': '/'
            }
         },
         '/myapi': {
            target: process.env.VUE_APP_API_MYBASEURL,
            ws: true,
            pathRewrite: {
               '^/myapi': '/'
            }
         }
      }
   },