/*
|
* @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",
|
}
|
}
|
}
|
};
|