话不多说,直接在controller方法里面加上这一句代码,访问那个方法那个方法就加上这个 getResponse().addHeader("Access-Control-Allow-Origin", "*");