// 获取img流文件
export const getImg = (data: string) => {
return axios.get(`${baseURL}/home/page/homeFiles?fileName=${data}`, {
responseType: "arraybuffer",
});
};
// 获取处理图片流文件
const getImg = async (val: any) => {
try {
const res = await homeImg(val.fileName)
const imageUrl = 'data:image/png;base64,' + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ''));
return imageUrl
} catch (error) {
console.error('catch--', error)
}
}
2852

被折叠的 条评论
为什么被折叠?



