diff --git a/src/router/config.ts b/src/router/config.ts index ffc4bf9..516570f 100644 --- a/src/router/config.ts +++ b/src/router/config.ts @@ -4,7 +4,7 @@ export const LOGIN_STRATEGY_MAP = { } // 登录策略,默认使用`无需登录策略`,即默认不需要登录就可以访问 export const LOGIN_STRATEGY = LOGIN_STRATEGY_MAP.DEFAULT_NO_NEED_LOGIN -export const isNeedLogin = LOGIN_STRATEGY === LOGIN_STRATEGY_MAP.DEFAULT_NEED_LOGIN +export const isNeedLoginMode = LOGIN_STRATEGY === LOGIN_STRATEGY_MAP.DEFAULT_NEED_LOGIN export const LOGIN_PAGE = '/pages/login/login' export const REGISTER_PAGE = '/pages/login/register' diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts index 1059d13..38ef0ea 100644 --- a/src/router/interceptor.ts +++ b/src/router/interceptor.ts @@ -6,7 +6,7 @@ import { useTokenStore } from '@/store/token' import { tabbarStore } from '@/tabbar/store' import { getLastPage, parseUrlToObj } from '@/utils/index' -import { EXCLUDE_PAGE_LIST, isNeedLogin, LOGIN_PAGE, LOGIN_PAGE_LIST } from './config' +import { EXCLUDE_PAGE_LIST, isNeedLoginMode, LOGIN_PAGE, LOGIN_PAGE_LIST } from './config' // 黑名单登录拦截器 - (适用于大部分页面不需要登录,少部分页面需要登录) export const navigateToInterceptor = { @@ -49,7 +49,7 @@ export const navigateToInterceptor = { console.log('tokenStore.hasLogin:', tokenStore.hasLogin) // #region 1/2 需要登录的情况 --------------------------- - if (isNeedLogin) { + if (isNeedLoginMode) { if (tokenStore.hasLogin) { return }