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

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
+14
View File
@@ -0,0 +1,14 @@
import path from 'path';
import { Inject, Service } from 'typedi';
import winston from 'winston';
import config from '../config';
@Service()
export default class LogService {
constructor(@Inject('logger') private logger: winston.Logger) {}
public checkFilePath(filePath: string, fileName: string) {
const finalPath = path.resolve(config.logPath, filePath, fileName);
return finalPath.startsWith(config.logPath) ? finalPath : '';
}
}