tt.getFileSystemManager()的writeFile报错
errMsg: "writeFile:fail params data type is not String type"
我的图片是base64的,图片可以正常访问
//将base64转为图片
base64ToSrc() {
const that = this;
//获取文件管理器对象
let fsm = uni.getFileSystemManager();
// #ifdef MP-TOUTIAO
let filePath = `${tt.env.USER_DATA_PATH}/demo2.png`;
console.log(filePath)
fsm.writeFile({
filePath: filePath,
data: that.shareImage,
encoding: 'base64',
success() {
that.downloadHsjcReport(filePath)
},
fail(err) {
console.log(err)
console.log('ERROR');
},
});
// console.log(that.shareImage)
// #endif
},
