Browse Source

修复bug ,日志查看bug

hl 11 tháng trước cách đây
mục cha
commit
6dc8ce5534
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      src/utils/file.js

+ 3 - 3
src/utils/file.js

@@ -112,13 +112,13 @@ function getLastFile(dirPath, number, callback) {
 // 读取日志(倒叙)指定行数
 function readLastNLines(dirPath, filePathList, n) {
     const fileList = filePathList.map((item) => {
-        var path = dirPath + "/" + item
+        var filepath = dirPath + "/" + item
         // 将相对路径转换为绝对路径
-        const directoryPath = path.resolve(path);
+        const directoryPath = path.resolve(filepath);
         logger.info("日志文件:" + directoryPath)
         let lines = [""]
         if (checkFilePath(directoryPath)) {
-            const content = fs.readFileSync(`${directoryPath}`, "utf8");
+            const content = fs.readFileSync(`${filepath}`, "utf8");
             lines = content.trim().split("\n");
         }
         return {