[Vuejs]-VueJs download picture from spring boot and display in <img>

0👍

I suggest you change the produces to MediaType.IMAGE_JPEG_VALUE

Example:

 @GetMapping(path = "/image", produces = MediaType.IMAGE_JPEG_VALUE)
    public @ResponseBody byte[] getImage() throws IOException {
        InputStream in = getClass().getResourceAsStream("image.jpg");
        return IOUtils.toByteArray(in);
    }

Leave a comment