From 900d279bf609fee02f260a8dbc02fa43481eb9bf Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Mon, 20 Sep 2021 00:59:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=BB=BA=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/script.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/back/api/script.ts b/back/api/script.ts index 60876fc5..f7933454 100644 --- a/back/api/script.ts +++ b/back/api/script.ts @@ -81,7 +81,9 @@ export default (app: Router) => { data: '文件路径禁止访问', }); } - + if (!originFilename) { + originFilename = filename; + } const originFilePath = `${path}${originFilename.replace(/\//g, '')}`; const filePath = `${path}${filename.replace(/\//g, '')}`; if (fs.existsSync(originFilePath)) {