vite 为基座 webpack3 子应用 会遇接口提示跨域问题 #709
Unanswered
you-hei-mi
asked this question in
Q&A
Replies: 1 comment
-
今天在试用micro是也遇到这个问题了,集成老项目请求时接口提示跨域,将下面代码配置到vue.config.js里面就可以了。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
子应用已配置
1、vue.config.js 开启跨域
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
},
}
2、request.js 拦截器与接口请求都没有写死域名和端口
子应用页面也被正常渲染,但是接口提示跨域。
报 Network Error 错误。
Beta Was this translation helpful? Give feedback.
All reactions