2023西安数博会CIM演示-【前端】-Web
AdaKing88
2023-08-21 bc03b832caa49bbcd2674fe4cae3701b5059bf95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2023-06-14 09:23:24
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2023-07-18 16:50:32
 * @FilePath: \cim-xian\vue.config.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
 
 
const path = require('path')
const resolve = dir => {
  return path.join(__dirname, dir)
}
module.exports = {
  lintOnSave: false,
  publicPath: "./",
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('_p', resolve('public'))
      .set('_c', resolve('src/components'))
  },
  productionSourceMap: false,
  devServer: {
    //proxy: "http://103.85.165.99:9006/"
    // // 配置跨域-请求后端的代理接口
 
  },
  configureWebpack: {
    resolve: { symlinks: true },
    devServer: {
      proxy: {
        "/dataapi": {
          // target: "http://103.85.165.99:9006", //对应自己的接口
          target: "http://103.85.165.99:9012", //对应自己的接口
          // target: "http://192.168.31.155:9999", //对应自己的接口
          changeOrigin: true,
          ws: true,
          pathRewrite: {
            "^/dataapi": ""
          }
        },
        "/app": {
          target: "http://103.85.165.99:9014", //对应自己的接口
          // target: "http://192.168.31.155:9999", //对应自己的接口
          changeOrigin: true,
          ws: true,
          pathRewrite: {
            "^/app": ""
          }
        },
      },
      headers: {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
        "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization",
        // "Cross-Origin-Opener-Policy": "same-origin", 
        // "Cross-Origin-Opener-Policy": "cross-origin",
        // "Cross-Origin-Embedder-Policy": "require-corp",
        "x-frame-options": "sameorigin",
      }
    }
  }
};