love-nav-vue/vue.config.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-12-20 18:30:11 +08:00
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
devServer: {
client: {
overlay: false // 编译错误时,取消全屏覆盖
},
proxy: {
'/api': {
//后端接口的baseurl
target: 'http://localhost:8082/helloGithub_war_exploded',
//是否允许跨域
changeOrigin: true,
// ws: true, //是否代理 websockets
// secure: true,
// 'secure': true,
headers: {
Connection: "kepp-alive"
},
pathRewrite: {
//这里的作用是使用去掉api
'^/api': ''
}
},
'/image': {
//后端接口的baseurl
target: 'https://tucdn.wpon.cn/api/',
//是否允许跨域
changeOrigin: true,
// ws: true, //是否代理 websockets
// secure: true,
// 'secure': true,
headers: {
Connection: "kepp-alive"
},
pathRewrite: {
//这里的作用是使用去掉api
'^/image': ''
}
},
}
}
})