const multer = require('multer');
const path = require('path');
const fs = require('fs');
const UUID = require('uuid');
const mkdir = require('../global/mkdir');
// 上传文件的位置
const uploadPath = default_config.upload_path;
( async ()=>{
    await mkdir(uploadPath);
})()
console.log(uploadPath);

const filename = (req, file, cb) => {
    console.log('filename');
    const name = UUID.v1();
    let type = file.originalname.split('.').reverse()[0];
    type = type ? `.${type}` : '';
    cb(null, `${name}${type}`);
}
