ajax 跨域问题 No 'Access-Control-Allow-Origin' header is present on the requested resource

接口:
public String get(HttpServletResponse response) throws Exception {
response.addHeader("Access-Control-Allow-Origin","*");
return "hello";
}


如果是静态文件html,则加上<meta http-equiv="Access-Control-Allow-Origin" content="*" />
posted @ 2020-03-10 16:26  覃上  阅读(194)  评论(0编辑  收藏  举报