From 383235168d974f6e34cb9b82cc8b80906e9089c0 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 5 Jun 2022 09:35:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=20inDev=20=E6=9D=A5=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEdev=E5=92=8Cprod=E7=9A=84=E4=B8=8D=E5=90=8C=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 63a7ada..aa9aeac 100644 --- a/index.js +++ b/index.js @@ -4,13 +4,12 @@ const crypto = require('crypto') const wo = global.wo module.exports = { - MulterStore: multer({ // dest:'./File/', // 这样,不能自定义文件名。 storage: multer.diskStorage({ destination (req, file, cb) { // 如果直接提供字符串,multer会负责创建该目录。如果提供函数,你要负责确保该目录存在。 - cb(null, wo?.envar?.File_Store) // 目录是相对于本应用的入口js的,即相对于 server.js 的位置。 + cb(null, wo?.envar?.fileStore) // 目录是相对于本应用的入口js的,即相对于 server.js 的位置。 }, filename (req, file, cb) { // 注意,req.body 也许还没有信息,因为这取决于客户端发送body和file的顺序。必要的信息请从 req.headers 传递,例如 _passtoken(在multer时,尚未进入路由,不存在已装好的 _passtokenSource) @@ -35,7 +34,6 @@ module.exports = { } else { return { _state: 'BASEND_FAIL_FILE_NOT_RECEIVED' } } - } - } - + }, + }, }