//过滤图片url
let base64 = imgSrc.replace(/^data:image\/\w+;base64,/, "")
//把图片转换成buffer对象
let dataBuffer = new Buffer(base64, 'base64')
//保存图片的地址是
let path = 'static/upload/image'+'.jpg'
//保存图片
fs.writeFile(path,dataBuffer,(err) => {
if(err) {
console.log(err)
}else {
console.log('保存图片成功')
}
})