fix: 修复页面被拦截情况下,tabbar仍被选中的问题

This commit is contained in:
Hygge
2025-07-31 15:34:31 +08:00
parent 2e9804f946
commit bb560572af
2 changed files with 10 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
import { tabbarStore } from '@/layouts/fg-tabbar/tabbar'
/**
* by 菲鸽 on 2024-03-06
* 路由拦截,通常也是登录拦截
@@ -49,6 +50,7 @@ const navigateToInterceptor = {
if (hasLogin) {
return true
}
tabbarStore.restorePrevIdx()
const redirectRoute = `${loginRoute}?redirect=${encodeURIComponent(url)}`
uni.navigateTo({ url: redirectRoute })
return false