小程序体验版打印出来的res.savedFilePath的值是类似于wxfile://store_adfsafkjlsdfjlksf.docx,但不应该是`${wx.env.USER_DATA_PATH}/xxxx.docx`吗?
const filePath = `${wx.env.USER_DATA_PATH}/temp1.docx`;
console.log({ filePath });
const fs = wx.getFileSystemManager();
fs.writeFile({
filePath,
data: data.base64,
encoding: "base64",
success: (res) => {
console.log("writeFile成功:", res);
fs.saveFile({
tempFilePath: filePath,
newPath: `${wx.env.USER_DATA_PATH}/xxxx.docx`,
success: (res) => {
console.log("文件保存成功:", res.savedFilePath);
},
});
},
fail: (err) => {
console.error("writeFile失败:", err);
},
});
又不看文档,哪来的应该啊