uni.request({
url: `http://admin.tcsjk.com/api/V1/imageCode?phone=${phone}`,
responseType: "arraybuffer",
success: res => {
let datas = res.data
this.imgCode = 'data:image/png;base64,' + btoa(
new Uint8Array(datas).reduce((datas, byte) => datas + String.fromCharCode(byte), '')
);
},
})
<u--image :src="imgCode" mode="widthFix" width="100%" height="70rpx" @click="getImgCode" />