From 8b4c84c44f7f9761c2bb32b66130ff8ae9aff5c7 Mon Sep 17 00:00:00 2001 From: FairyEver <1711467488@qq.com> Date: Tue, 16 Jul 2019 20:48:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=89=E5=BE=85=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=95=B0=E6=8D=AE=E7=9A=84=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 7809445278ada4428e805392c1c74e6e23d535d5 [formerly 7809445278ada4428e805392c1c74e6e23d535d5 [formerly 7809445278ada4428e805392c1c74e6e23d535d5 [formerly 7809445278ada4428e805392c1c74e6e23d535d5 [formerly ace2c2a58253ce3f9a56c78a7808c580021a2936 [formerly 2eb3b298bc56bfa2e28947e2384da9afd8b62d7e]]]]] Former-commit-id: 8f13d8c2018f66b3087fbeb21f95b28acfbd290b Former-commit-id: 3f813f3490893b93e9f3b37469206612d3fabb8f Former-commit-id: 570afa5e4472ad8aa025a8f0db56a0643116e14e [formerly 55d5504bef46d75474e6ac27b78f03d09ce8be7c] Former-commit-id: 77c11b4f77ac587c3c9025c9b88e8ea913a38ea8 Former-commit-id: c77e00d5399f77afd4f453d7922c7b9ba4dcf6a2 Former-commit-id: 8a947ed537946139c236d6415d4a81047e0deb8c Former-commit-id: 94be69316dd385b4b3d74a26c517f80a2f9da0ec Former-commit-id: 1926124e7eee320fbfe7826b70ed2fe21fdfa427 --- src/router/index.js | 12 +++--------- .../modules/d2admin/modules/page.js.REMOVED.git-id | 2 +- src/store/modules/d2admin/modules/size.js | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index e3e0f001..e9adc225 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -24,15 +24,9 @@ const router = new VueRouter({ * 权限验证 */ router.beforeEach(async (to, from, next) => { - // 等待数据加载 https://github.com/d2-projects/d2-admin/issues/201 - await new Promise (resolve => { - const timer = setInterval(() => { - if (store.state.d2admin.page.openedLoaded) { - resolve(clearInterval(timer)) - } - }, 10) - }) - // 等待加载组件尺寸 https://github.com/d2-projects/d2-admin/issues/198 + // 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201 + await store.dispatch('d2admin/page/isLoaded') + // 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198 await store.dispatch('d2admin/size/isLoaded') // 进度条 NProgress.start() diff --git a/src/store/modules/d2admin/modules/page.js.REMOVED.git-id b/src/store/modules/d2admin/modules/page.js.REMOVED.git-id index 960129f9..3520f687 100644 --- a/src/store/modules/d2admin/modules/page.js.REMOVED.git-id +++ b/src/store/modules/d2admin/modules/page.js.REMOVED.git-id @@ -1 +1 @@ -9497ec44eb1bff086d98a4917a8aba46abed1fe0 \ No newline at end of file +f6db6b641667fe94ef45b30706bc285c62e33d1b \ No newline at end of file diff --git a/src/store/modules/d2admin/modules/size.js b/src/store/modules/d2admin/modules/size.js index c2748acb..e5bdb4a6 100644 --- a/src/store/modules/d2admin/modules/size.js +++ b/src/store/modules/d2admin/modules/size.js @@ -20,7 +20,7 @@ export default { } }, /** - * @description 确认组件尺寸已经加载 https://github.com/d2-projects/d2-admin/issues/198 + * @description 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198 */ isLoaded ({ state }) { if (state.value) return Promise.resolve()