修复获取日志相对目录

This commit is contained in:
whyour 2022-03-30 11:34:36 +08:00
parent 92673b4a17
commit b2ba86b212

View File

@ -360,7 +360,7 @@ export default class CronService {
} }
if (doc.log_path) { if (doc.log_path) {
const relativeDir = `${doc.log_path.replace(/\/[^\/]\..*/, '')}`; const relativeDir = path.dirname(`${doc.log_path}`);
const dir = path.resolve(config.logPath, relativeDir); const dir = path.resolve(config.logPath, relativeDir);
if (existsSync(dir)) { if (existsSync(dir)) {
let files = await promises.readdir(dir); let files = await promises.readdir(dir);