const getOSSBlobResource = (url: string): Promise<Blob> => {
return new Promise((resolve) => {
const xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "blob";
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.onload = () => {
if (xhr.status === 200) {
resolve(xhr.response);
}
};
xhr.send();
});
}
oss 转64图片跨域
最新推荐文章于 2024-06-14 11:01:38 发布