Fix optional path compatibility checks

This commit is contained in:
涛之雨 2025-08-26 23:00:07 +08:00 committed by GitHub
parent 53a96462b2
commit 719a32c191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,7 +85,7 @@ export default (app: Router) => {
try {
const scriptService = Container.get(ScriptService);
const content = await scriptService.getFile(
req.query.path as string,
req.query?.path as string || '',
req.query.file as string,
);
res.send({ code: 200, data: content });