获取对象 HttpServletResponse response
在接口开始加上这么一行代码即可
response.addHeader("Access-Control-Allow-Origin","*");