wx.openDocument打开txt文件,在安卓下成功打开,在ios下失败?
const FileSystemManager = wx.getFileSystemManager(); var filePath = `${wx.env.USER_DATA_PATH}/test.txt`; console.log('filePath:', filePath); FileSystemManager.writeFileSync(filePath, ’hello world~~‘, 'utf8'); const temp = FileSystemManager.readFileSync(filePath, 'utf8'); console.log("文件内容:", temp); wx.openDocument({ filePath: filePath, success: function(res) { console.log("打开文档成功", res); }, fail: function(res) { console.log("打开文档失败", res); } }) |
