feat(login): wip 登录系统

This commit is contained in:
feige996
2025-08-18 22:01:55 +08:00
parent e8478c9d43
commit 6aa4bc3472
5 changed files with 19 additions and 10 deletions

View File

@@ -5,6 +5,7 @@
* 我这里应为大部分都可以随便进入,所以使用黑名单
*/
import { useUserStore } from '@/store'
import { tabbarStore } from '@/tabbar/store'
import { getLastPage } from '@/utils'
import { EXCLUDE_LIST, LOGIN_PAGE_LIST } from '../login/config'
@@ -14,6 +15,9 @@ export const navigateToInterceptor = {
// 增加对相对路径的处理BY 网友 @ideal
invoke({ url }: { url: string }) {
console.log(url) // /pages/route-interceptor/index?name=feige&age=30
if (url === undefined) {
return
}
let path = url.split('?')[0]
// 处理相对路径
@@ -24,6 +28,9 @@ export const navigateToInterceptor = {
path = `${baseDir}/${path}`
}
// 处理直接进入路由非首页时tabbarIndex 不正确的问题
tabbarStore.setAutoCurIdx(path)
if (LOGIN_PAGE_LIST.includes(path)) {
console.log('000')
return
@@ -34,8 +41,6 @@ export const navigateToInterceptor = {
return
}
// tabbarStore.restorePrevIdx()
console.log('拦截器中得到的 path:', path, userStore.hasLogin)
if ([...EXCLUDE_LIST, ...LOGIN_PAGE_LIST].includes(path)) {