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)) {