folderPath:文件夹的路径
function deleteFiles(folderPath) {
const fs = require('fs');
const path = require('path');
let forlder_exists = fs.existsSync(folderPath);
if (forlder_exists) {
let fileList = fs.readdirSync(folderPath);
fileList.forEach(function (fileName) {
fs.unlinkSync(path.join(folderPath, fileName));
});
}
}