You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
594 B

// const { defineConfig } = require('@vue/cli-service')
// module.exports = defineConfig({
// transpileDependencies: true
// })
module.exports = {
devServer: {
// 代理配置
proxy: {
// 当我们本地访问带有/api的时候才会触发跨域
'/api': {
target: 'http://localhost:18021', // 要代理的地址
changeOrigin: true, // 是否跨域,需要设置为true
// 路径重写
pathRewrite: {
// 路径重写默认 localhost: xxx/api/abc => www.xxx.com/api/abc
'^/api': '' // 设置为 localhost: xxx/api/abc => www.xxx.com/abc
}
}
}
}
}