From 034e2cdb4b65e02fb05c48effd452d7f1b1862ac Mon Sep 17 00:00:00 2001 From: leiyun Date: Mon, 19 May 2025 16:11:29 +0800 Subject: [PATCH] save test 404 --- src/home/controller/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/home/controller/index.js b/src/home/controller/index.js index 803ec9f..0cedcb3 100644 --- a/src/home/controller/index.js +++ b/src/home/controller/index.js @@ -302,15 +302,16 @@ export default class extends Base { let params = this.param(); let file = params.file; console.log('file:--------------->', file); - if (!file || file.includes('test-') == -1) { - return this.fail('文件名错误'); - } + // 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('文件名错误'); + this.status(404); + return this.json(""); } } } \ No newline at end of file