瀏覽代碼

日志查询bug

hl 1 年之前
父節點
當前提交
86c0c02783
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/web.js

+ 2 - 3
src/web.js

@@ -95,11 +95,10 @@ function init() {
         if (port !== -1) {
             var logPath = "./logs" + port
             // 将相对路径转换为绝对路径
-            const directoryPath = path.resolve(logPath);
             // file.checkPathSync(directoryPath)
-
-            logger.info(`日志相对地址:${logPath}`)
             try {
+                const directoryPath = path.resolve(logPath);
+                logger.info(`日志相对地址:${logPath}`)
                 file.getLastFile(logPath, 10, (fileNameList) => {
                     // logger.info('??1:', fileNameList);
                     result = file.readLastNLines(logPath, fileNameList, n);