【发布时间】:2021-01-23 23:05:47
【问题描述】:
我有一个基本的 react-app 在 localhost:3000 上运行。
该 react-app 对 localhost:9093 上的 SpringBoot 应用程序进行 axios 调用。 9093 上的应用程序使用 Spring MVC 将重定向返回到 localhost:8183 上的另一个 SpringBoot 应用程序。最后,8183 上的应用将重定向返回到localhost:3000 上的 react-app。
当我尝试这个时,我在我的 chrome 开发工具中收到以下消息:
Access to XMLHttpRequest at 'http://localhost:3000/?err_code=inv_otk' (redirected from 'http://localhost:9093/saml?email=a@a.com') from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
如果最终目的地和起点都在localhost:3000,为什么我会遇到问题?
如果需要更多信息,请告诉我!
【问题讨论】:
标签: javascript reactjs spring spring-boot spring-mvc