cross-origin request blocked / ajax 返回的HTTP状态码 status 为0

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wuzhong8809/article/details/83505064

cross-origin request blocked / ajax  返回的HTTP状态码 status 为0

调试的时候可以这样处理:


@RequestMapping("/img")
@RestController
public class ImgController {

    @GetMapping
    public Object getImgList(HttpServletResponse response)  {       

        String ret = "";
        response.addHeader("Access-Control-Allow-Origin", "*");
        return ret.toString();
    }
}

具体参看:

https://blog.csdn.net/u011037503/article/details/78025072

猜你喜欢

转载自blog.csdn.net/wuzhong8809/article/details/83505064