has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control

http://www.javashuo.com/article/p-xcprhdot-gt.htmlhtml

 

// TODO 支持跨域訪問
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Credentials", "true");
        response.setHeader("Access-Control-Allow-Methods", "*");
        response.setHeader("Access-Control-Allow-Headers", "Content-Type,Access-Token");
        response.setHeader("Access-Control-Expose-Headers", "*");

        if (request.getMethod().equals("OPTIONS")) {
            HttpUtil.setResponse(response, HttpStatus.OK.value(), null);
            return;
        }
相關文章
相關標籤/搜索