From e85144700611cf6d6218ae17948f556f00ac52e2 Mon Sep 17 00:00:00 2001 From: leiyun Date: Mon, 19 May 2025 15:38:00 +0800 Subject: [PATCH] =?UTF-8?q?save=20=E6=96=87=E4=BB=B6=E5=90=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/home/controller/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/home/controller/index.js b/src/home/controller/index.js index 3eb867d..d0fffc2 100644 --- a/src/home/controller/index.js +++ b/src/home/controller/index.js @@ -301,13 +301,15 @@ export default class extends Base { async lechallengeAction () { let params = this.param(); let file = params.file; - if (!file.startsWith('test-')) { + console.log('file:--------------->', file); + if (!file || file.includes('test-') == -1) { return this.fail('文件名错误'); } try { let txt = fs.readFileSync(path.join(LECHALLENGE_PATH, params.file)) this.json(txt); } catch (e) { + console.log('文件名错误', e); return this.fail('文件名错误'); } }