uni-app 旧云存储文件无法通过web后台整体删除目录?

uni-app 旧云存储文件无法通过web后台整体删除目录?

想通过web后台整体删除文件却不允许删除非空目录,但是文件几百万个,不可能让我一个个手动删除吧

1 回复

更多关于uni-app 旧云存储文件无法通过web后台整体删除目录?的实战教程也可以访问 https://www.itying.com/category-93-b0.html


针对uni-app旧云存储无法批量删除非空目录的问题,建议通过以下方式解决:

  1. 使用云函数批量删除: 可以编写一个云函数,递归遍历目录下的所有文件进行删除。示例代码:
const cloud = require('wx-server-sdk')
cloud.init()

exports.main = async (event, context) => {
  const { fileList } = event
  const result = await cloud.deleteFile({
    fileList: fileList
  })
  return result
}
回到顶部