无需后端配置即可跨域
参考资料:https://www.mmxiaowu.com/article/584820e1d4352863efb55458
// config/dev.env.js,指定路径前缀
BASE_API: '""',
// config/index.js,指定代理
proxyTable: {
'/api/**/': {
target: 'http://127.0.0.1:8000'
}
},无需后端配置即可跨域
参考资料:https://www.mmxiaowu.com/article/584820e1d4352863efb55458
// config/dev.env.js,指定路径前缀
BASE_API: '""',
// config/index.js,指定代理
proxyTable: {
'/api/**/': {
target: 'http://127.0.0.1:8000'
}
},相关阅读