首页 > 其他 > 详细

从服务器读取图片并显示

时间:2020-07-14 10:44:03      阅读:84      评论:0      收藏:0      [点我收藏+]
@GetMapping("/onlineCheckCar/loading")
    public ResponseEntity loadingPicture(String imgUrl) {
        try {
            return ResponseEntity.ok(resourceLoader.getResource("file:" + imgUrl));
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseEntity.notFound().build();
        }
    }

  前端定义一个BaseUrl

baseUrl: "/api/v1.0/offlineOrder/onlineCheckCar/loading?imgUrl="

  

 <img
              width="100%"
              :src="baseUrl+encodeURI(row.orderLicenseUrl)"
              v-if="row.orderLicenseUrl!=‘‘&&row.orderLicenseUrl!=undefined"
            />

  

从服务器读取图片并显示

原文:https://www.cnblogs.com/song1024/p/13297293.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!