const time = new Date().getTime(); //自定义文件名
const filePath = `${wx.env.USER_DATA_PATH}/${time}.${format}`;
const buffer = wx.base64ToArrayBuffer(bodyData);
wx.getFileSystemManager().writeFile({
filePath,
data: buffer,
encoding: 'binary',
success() {
console.log("OK")
},
fail() {
return (new Error('ERROR_BASE64SRC_WRITE'));
},
});