|
|
|
@@ -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(""); |
|
|
|
} |
|
|
|
} |
|
|
|
} |