const fs = require("fs");

const base64 = base64_URL.replace(/^data:image\/\w+;base64,/, "");
const path = `${imagePath}${Date.now()}${index}.png`;
fs.writeFile(path, base64, 'base64', function (err) {
if (err) {
console.log(err);
} else {
console.log('写入成功!', path);
}
});