hadleGetWatermark(){
_getWatermarkPreviewPicture ({
responseType: "arraybuffer",//请求头设置要传得
}).then(res => {
this.picture = "data:image/png;base64," +
btoa(
new Uint8Array(res.data).reduce(
(data, byte) => data + String.fromCharCode(byte),
""
)
)
this.$store.commit("watermarkhandone", this.picture);
})
},
前端二进制流文件转base64
最新推荐文章于 2024-09-09 17:33:35 发布