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); } }) |
2 回复
具体是什么问题?麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)