From df5578f267308f1e270ef6e5e910f543f358e756 Mon Sep 17 00:00:00 2001 From: fanxb Date: Thu, 28 Apr 2022 10:41:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E4=BC=98=E5=8C=96=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E7=99=BD=E5=B1=8F=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=BF=87=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bookmark_front/src/store/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bookmark_front/src/store/index.js b/bookmark_front/src/store/index.js index 7e865a3..13cc15e 100644 --- a/bookmark_front/src/store/index.js +++ b/bookmark_front/src/store/index.js @@ -22,7 +22,8 @@ let noLoginFinish = false; //执行各自的非登陆初始化 (async () => { await store.dispatch(globalConfig.GLOBAL_CONFIG + "/" + globalConfig.noLoginInit); - await store.dispatch(treeData.TREE_DATA + "/" + treeData.noLoginInit); + //无需等待执行 + store.dispatch(treeData.TREE_DATA + "/" + treeData.noLoginInit); noLoginFinish = true; })(); @@ -35,8 +36,9 @@ export async function loginInit () { } console.log(store.state[globalConfig.GLOBAL_CONFIG][globalConfig.TOKEN]); if (checkJwtValid(store.state[globalConfig.GLOBAL_CONFIG][globalConfig.TOKEN])) { - await store.dispatch(globalConfig.GLOBAL_CONFIG + "/" + globalConfig.loginInit); - await store.dispatch(treeData.TREE_DATA + "/" + treeData.loginInit); + //无需等待执行完毕 + store.dispatch(globalConfig.GLOBAL_CONFIG + "/" + globalConfig.loginInit); + store.dispatch(treeData.TREE_DATA + "/" + treeData.loginInit); } }