mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复文件下载参数
This commit is contained in:
+4
-1
@@ -232,7 +232,7 @@ export default (app: Router) => {
|
||||
celebrate({
|
||||
body: Joi.object({
|
||||
filename: Joi.string().required(),
|
||||
path: Joi.string().allow(''),
|
||||
path: Joi.string().optional().allow(''),
|
||||
}),
|
||||
}),
|
||||
async (req: Request, res: Response, next: NextFunction) => {
|
||||
@@ -241,6 +241,9 @@ export default (app: Router) => {
|
||||
filename: string;
|
||||
path: string;
|
||||
};
|
||||
if (!path) {
|
||||
path = '';
|
||||
}
|
||||
const scriptService = Container.get(ScriptService);
|
||||
const filePath = scriptService.checkFilePath(path, filename);
|
||||
if (!filePath) {
|
||||
|
||||
Reference in New Issue
Block a user