rename user 'uuid' to 'usid'
This commit is contained in:
parent
ce883f0d03
commit
f08e8f48ac
@ -16,7 +16,7 @@ module.exports = {
|
||||
const fileNameExtension = path.extname(file.originalname)
|
||||
const filename = `${Date.now()}_${crypto.randomBytes(16).toString('hex')}${fileNameExtension}`
|
||||
//const _passtokenSource = webtoken.verifyToken(req.headers._passtoken) || {}
|
||||
//const filename = `${req.path.replace(/^\/api\d*/, '')}_${_passtokenSource.uuid}_${Date.now()}${fileNameExtension}` // 如果最终 filename 含有 / (例如当 req.path 为 Who/todo),则必须已经存在该目录,否则在这里就出错,不会进入下面流程。
|
||||
//const filename = `${req.path.replace(/^\/api\d*/, '')}_${_passtokenSource.usid}_${Date.now()}${fileNameExtension}` // 如果最终 filename 含有 / (例如当 req.path 为 Who/todo),则必须已经存在该目录,否则在这里就出错,不会进入下面流程。
|
||||
cb(null, filename)
|
||||
},
|
||||
// req 被 multer 处理后,req.file 为 { destination, filename, originialname, path, mimetype, size }, 其中 path 包括了 destination 和 filename 的文件完整路径。
|
||||
|
Loading…
Reference in New Issue
Block a user