From f6c2d8fb6e93140facf540117c8f28ec346095f9 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Mon, 2 Sep 2024 18:05:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=BD=93=E5=89=8D=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E8=AE=BE=E7=BD=AE=E8=B7=AF=E7=94=B1=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/router.js b/router.js index dc5fd9f..59a4d4b 100644 --- a/router.js +++ b/router.js @@ -74,13 +74,23 @@ router.beforeEach((to, from, next) => { // #endif - console.log(to,from, 'beforeEach---开始跳转') let index = whiteList.findIndex((item) => from.path.includes(item)) if (index == -1 && !store.getters.token) { Cache.set(BACK_URL, from.fullPath) } if (to.meta.auth && !store.getters.token) { + // #ifdef APP-PLUS + next(false) + uni.navigateTo({ + url: '/pages/login/login' + }) + // #endif + // #ifdef H5 next('/pages/login/login'); + // #endif + // #ifdef MP + next('/pages/login/login'); + // #endif return } else { next()