mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
脚本管理和日志管理支持下载
This commit is contained in:
@@ -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 : '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user