提交 d1b86b97 authored 作者: 邓文彬's avatar 邓文彬

fix(Pad): 日志数据清洗

上级 c58687b4
...@@ -76,7 +76,7 @@ const store = new Vuex.Store({ ...@@ -76,7 +76,7 @@ const store = new Vuex.Store({
state.all_data = payload; state.all_data = payload;
}, },
SET_LOG_LIST(state, payload) { SET_LOG_LIST(state, payload) {
console.log("保存 日志文件----", payload); // console.log("保存 日志文件----", payload);
// 保存 日志文件 // 保存 日志文件
state.log_list = payload; state.log_list = payload;
}, },
......
...@@ -80,11 +80,11 @@ export const readLogData = () => { ...@@ -80,11 +80,11 @@ export const readLogData = () => {
readFilesInDirectory(directoryPath) readFilesInDirectory(directoryPath)
.then((res) => { .then((res) => {
const temp = res.map((element) => { const temp = res.map((element) => {
return JSON.parse(Base64.decode(element)); return JSON.parse(Base64.decode(element));
}); });
// console.log("读取志文件数据--", temp); // console.log("读取志文件数据--", temp);
resolve(temp); resolve(lodash.flattenDeep(temp));
}) })
.catch((error) => reject(error)); .catch((error) => reject(error));
}); });
...@@ -127,7 +127,7 @@ export const readDarfData = () => { ...@@ -127,7 +127,7 @@ export const readDarfData = () => {
if (!res.length) { if (!res.length) {
resolve({}); resolve({});
} else { } else {
console.log("读取草稿文件--", JSON.parse(Base64.decode(res))); // console.log("读取草稿文件--", JSON.parse(Base64.decode(res)));
resolve(JSON.parse(Base64.decode(res))); resolve(JSON.parse(Base64.decode(res)));
} }
}) })
......
...@@ -315,13 +315,13 @@ export const readFilesInDirectory = async (directoryPath) => { ...@@ -315,13 +315,13 @@ export const readFilesInDirectory = async (directoryPath) => {
} }
} }
Promise.all(promiseArr) Promise.all(promiseArr)
.then((res) => { .then((res) => {
resolve(res); resolve(res);
}) })
.catch((error) => { .catch((error) => {
reject("读取文件内容失败:" + error.message); reject("读取文件内容失败:" + error.message);
}); });
}, },
function (error) { function (error) {
reject("读取目录条目失败:" + error.message); reject("读取目录条目失败:" + error.message);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论