后端:
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletResponse res = (HttpServletResponse)response; final HttpServletRequest req = (HttpServletRequest)request; // res.setHeader("Access-Control-Allow-Origin", "*");