tt.getFileSystemManager()的writeFile报错
1033 浏览2022年07月19日作者:喵克人工智能编程+

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

},


最后一次编辑于 2022 年 07 月 19 日
2 条评论

相关文章

专题推荐

热门文章

热门问答