- 当报以下问题时候为跨域问题
XMLHttpRequest cannot load http://xxxxxxx. Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://xxxx’ is therefore not allowed access.
- 方便调试,设置Chrome浏览器安全策略
- 右键Chrome快捷图标
- 创建一个自定义空文件夹
- 在目标加入以下内容:
--disable-web-security --user-data-dir=(该位置为自定义创建的文件夹,存放数据)
- 重启即可