谷歌浏览器运行HTML文件报 No 'Access-Control-Allow-Origin' header is present on the requested resource
html + Vue.js + ajax ======》 Java接口错误提示:Access to XMLHttpRequest at 'HTTP/HTTPS接口' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the req...
·
html + Vue.js + ajax ======》 Java接口
错误提示:
Access to XMLHttpRequest at 'HTTP/HTTPS接口' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
解决方法:
接口中设置: response.setHeader("Access-Control-Allow-Origin", "*"); # 建议吧 * 换成 域名
更多推荐
已为社区贡献1条内容
所有评论(0)