From afb98867569b8618e05bf993bbdd7d6c3d72d2b3 Mon Sep 17 00:00:00 2001 From: fanxb Date: Sun, 29 Mar 2020 16:35:09 +0800 Subject: [PATCH] fix:issues-2 --- front/src/util/cacheUtil.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/front/src/util/cacheUtil.js b/front/src/util/cacheUtil.js index b48ee38..f155cc8 100644 --- a/front/src/util/cacheUtil.js +++ b/front/src/util/cacheUtil.js @@ -45,8 +45,10 @@ export async function cacheBookmarkData() { * @param {*} path path */ export function getBookmarkList(path) { - let data = window[TREE_LIST_KEY][path]; - return data ? data : []; + if (window[TREE_LIST_KEY][path] === undefined) { + window[TREE_LIST_KEY][path] = []; + } + return window[TREE_LIST_KEY][path]; } /** @@ -83,6 +85,7 @@ export async function updateCurrentChangeTime() { * @param {*} node */ export async function addNode(currentNode, node) { + debugger; let treeDataMap = window[TREE_LIST_KEY]; if (currentNode) { let key = currentNode.path + "." + currentNode.bookmarkId;