getSavedFileList返回fileList为空
1、在手机上调试,调用
wx.getFileSystemManager().saveFileSync
保存图片失败,才发现我存储了过多的本地图片,超过了10M。

2、为了解决该问题,我试着去获取已经保存过的图片地址列表,但是fileList里面是个空数组。截图如下:

3、本来如果能获取到已存储的图片地址列表,可以调用unlinkSync接口删除;但是目前我不清楚我之前保存了哪些图片,所以该问题就卡住了。

2 回复
wx.getSavedFileList() 是获取【缓存文件】,而 saveFile 存文件操作的是【用户文件】,这是两个不同的文件区划。
https://developers.weixin.qq.com/miniprogram/dev/framework/ability/file-system.html

所以应该访问【用户文件】
let fs = wx.getFileSystemManager()
fs.readdir(wx.env.USER_DATA_PATH)