前段时间在开发项目的时候,遇到一个比较稀奇古怪的跨域问题,不管怎么写就是解决不了,后来通过Chrome浏览器的设置,解决了跨域问题,这样就不需要在项目里通过设置代理来解决跨域问题,直接通过设置修改Chrome浏览器的设置就可以解决项目跨域问题。具体的跨域问题如下所示:
Access to XMLHttpRequest at 'https://weixin.xxx.com/ems/login' (redirected from 'http://localhost:8081/xxx/queryBalance') from origin 'http://localhost:8081' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
本篇博文就来分享一下上述情况的操作