From 13158994937e830ccf9d8760bbdf23082ec8ecd2 Mon Sep 17 00:00:00 2001 From: MaYuanhai <414199639@qq.com> Date: Tue, 14 Jan 2020 14:33:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84NP?= =?UTF-8?q?rogress.done()=EF=BC=88/src/permission.js=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit router.afterEach 足够关闭所有的进度条 --- src/permission.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/permission.js b/src/permission.js index 750aeab6..61ce293f 100644 --- a/src/permission.js +++ b/src/permission.js @@ -24,7 +24,6 @@ router.beforeEach(async(to, from, next) => { if (to.path === '/login') { // if is logged in, redirect to the home page next({ path: '/' }) - NProgress.done() } else { // determine whether the user has obtained his permission roles through getInfo const hasRoles = store.getters.roles && store.getters.roles.length > 0 @@ -50,7 +49,6 @@ router.beforeEach(async(to, from, next) => { await store.dispatch('user/resetToken') Message.error(error || 'Has Error') next(`/login?redirect=${to.path}`) - NProgress.done() } } } @@ -63,7 +61,6 @@ router.beforeEach(async(to, from, next) => { } else { // other pages that do not have permission to access are redirected to the login page. next(`/login?redirect=${to.path}`) - NProgress.done() } } })