脚本管理和日志管理支持下载

This commit is contained in:
whyour
2025-03-13 00:22:24 +08:00
parent 118c92d9e5
commit cf94ecfb11
8 changed files with 231 additions and 131 deletions
+7 -2
View File
@@ -64,10 +64,15 @@ export default class ScriptService {
return { code: 200 };
}
public async getFile(filePath: string, fileName: string) {
public checkFilePath(filePath: string, fileName: string) {
const finalPath = path.resolve(config.scriptPath, filePath, fileName);
return finalPath.startsWith(config.scriptPath) ? finalPath : '';
}
if (!finalPath.startsWith(config.scriptPath)) {
public async getFile(filePath: string, fileName: string) {
const finalPath = this.checkFilePath(filePath, fileName);
if (!finalPath) {
return '';
}