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", "*");    # 建议吧 * 换成 域名

 

Logo

前往低代码交流专区

更多推荐