|
|
|
@@ -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('文件名错误'); |
|
|
|
} |
|
|
|
} |