From 29f0c2c9ace7c155e3de9d8253a8a2ebf6262be2 Mon Sep 17 00:00:00 2001 From: whyour Date: Wed, 7 Feb 2024 20:08:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=B9=E6=AF=94=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E4=BF=9D=E5=AD=98=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/back/api/config.ts b/back/api/config.ts index eaa4c4c5..f2e6e69c 100644 --- a/back/api/config.ts +++ b/back/api/config.ts @@ -89,7 +89,10 @@ export default (app: Router) => { if (config.blackFileList.includes(name)) { res.send({ code: 403, message: '文件无法访问' }); } - const path = join(config.configPath, name); + let path = join(config.configPath, name); + if (name.startsWith('data/scripts/')) { + path = join(config.rootPath, name); + } await fs.writeFile(path, content); res.send({ code: 200, message: '保存成功' }); } catch (e) {