From 9fc8f24a8598313acdd719d639d213e9bbe4e728 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Fri, 22 Aug 2025 17:12:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor(router):=20=E5=B0=86=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BB=8Elogin.ts=E8=BF=81=E7=A7=BB=E5=88=B0c?= =?UTF-8?q?onfig.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 简化路由配置结构,将登录相关配置集中到config.ts文件中 更新interceptor.ts中的引用路径 --- src/router/{login.ts => config.ts} | 0 src/router/interceptor.ts | 5 ++--- 2 files changed, 2 insertions(+), 3 deletions(-) rename src/router/{login.ts => config.ts} (100%) diff --git a/src/router/login.ts b/src/router/config.ts similarity index 100% rename from src/router/login.ts rename to src/router/config.ts diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts index 6fe692c..1059d13 100644 --- a/src/router/interceptor.ts +++ b/src/router/interceptor.ts @@ -1,13 +1,12 @@ /** * by 菲鸽 on 2025-08-19 * 路由拦截,通常也是登录拦截 - * 可以设置路由白名单,或者黑名单,看业务需要选哪一个 - * 我这里应为大部分都可以随便进入,所以使用黑名单 + * 黑白名单的配置,请看 config.ts 文件, EXCLUDE_PAGE_LIST */ 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 './login' +import { EXCLUDE_PAGE_LIST, isNeedLogin, LOGIN_PAGE, LOGIN_PAGE_LIST } from './config' // 黑名单登录拦截器 - (适用于大部分页面不需要登录,少部分页面需要登录) export const navigateToInterceptor = {