本文共 680 字,大约阅读时间需要 2 分钟。
服务器端本身是支持跨域的,所有请求都可以进入后台,只是返回的时候如果不是同源请求,js不接受,防止安全问题,需要服务端在返回头中明确规定支持,则可以接受跨域
myCorsFilter org.springframework.web.filter.DelegatingFilterProxy targetBeanName corsFilter myCorsFilter /*
这里使用了DelegatingFilterProxy代理corsFilter,这样做的好处是把filter的创建也交给了spring管理。
转载地址:http://nhjqi.baihongyu.com/