关于图片上传

图片资源可能有缓存,那么在返回图片后,加上时间戳来防止缓存的问题:
eg:

this.photoSrc="";
// res.url存在的时候,加时间戳,要不然就在html中使用默认的图片
if(res.url){
  this.photoSrc=res.url+'?v='+new Date().getTime();
}

<img src="{{photoSrc?photoSrc:'../assets/imags/abc.png'}}" alt="">

猜你喜欢

转载自blog.csdn.net/weixin_42995876/article/details/82770801