ts基础
914 2023-04-03 05:19:49
通过decl脚手架构建 vue2.6 自己建的vue.config.js中配置好
// const proxy = {
// '/api': {
// target: 'http://localhost:20082/',
// changeOrigin: true
// }
// }
module.exports = {
devServer: {
host: '0.0.0.0', // 允许外部ip访问
port: 9000, // 服务启动端口
compress: true,
disableHostCheck: true,
headers: {
'Access-Control-Allow-Origin': '*'
},
proxy: {
'/api': {
target: 'http://localhost:20082', // 跨域地址
ws: true,
changOrigin: true, //允许跨域
}
}
}
}