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

https://www.cnblogs.com/caimuqing/p/6733405.html

 

// 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;
        }

 

上一篇:selenium实战:操作3种提示框


下一篇:爬虫实现:根据IP地址反查域名