From 7de39e7f1107393d7af66166b44446e0fd4d4a27 Mon Sep 17 00:00:00 2001 From: dydwang <1836963576@qq.com> Date: Thu, 23 Sep 2021 13:50:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- global/mkdir.js | 21 --------------------- middleware/multer.js | 19 ------------------- routes/index.js | 2 +- 3 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 global/mkdir.js delete mode 100644 middleware/multer.js diff --git a/global/mkdir.js b/global/mkdir.js deleted file mode 100644 index fec2537..0000000 --- a/global/mkdir.js +++ /dev/null @@ -1,21 +0,0 @@ -const fs = require('fs'); -module.exports = async function mkdir(filePath) { - console.log(filePath); - if (await fs.existsSync(filePath)) { - console.log('该路径已存在'); - }else{ - console.log('该路径不存在'); - const dirCache={}; - filePath=filePath.replace(/\\/g,"/"); - console.log(filePath); - const arr=filePath.split('/'); - let dir=arr[0]; - for(let i=1;i{ - 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}`); -} diff --git a/routes/index.js b/routes/index.js index a385708..f3eb2ad 100644 --- a/routes/index.js +++ b/routes/index.js @@ -3,7 +3,7 @@ const router = express.Router(); const styleRouter = require('./styles'); /* GET home page. */ router.get('/', function(req, res, next) { - res.render('index', { title: 'node-aoi' }); + res.render('index', { title: 'logistics-node' }); }); router.use('/styles', styleRouter);