Skip to content

Commit

Permalink
Merge branch '1.x-stable' of github.com:NSFI/ppfish-components into 1…
Browse files Browse the repository at this point in the history
….x-stable
  • Loading branch information
storm committed Aug 11, 2022
2 parents 1af8ce5 + f737927 commit b628a8b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/components/PicturePreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,12 @@ class PicturePreview extends Component<PicturePreviewProps, PicturePreviewState>
dLink.click();
});
};
// 在URL后添加随机数以避免浏览器缓存,使crossOrigin生效
img.src = this.imgEl.src + '?' + +new Date();
// 在URL后添加随机数以避免浏览器缓存,使crossOrigin生效(拼接前判断 src 中是否已有 ?)
if (this.imgEl.src && this.imgEl.src.indexOf('?') < 0) {
img.src = this.imgEl.src + '?' + +new Date();
} else {
img.src = this.imgEl.src + '&' + +new Date();
}
};

handleFullChange = e => {
Expand Down

0 comments on commit b628a8b

Please sign in to comment.