From 657ed310773830a4dd8586b4247514cd94184f80 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Sat, 6 Sep 2025 21:30:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(router):=20=E4=BF=AE=E6=AD=A3=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=90=8DLOGIN=5FPAGE=5FENABLE=5FIN=5FWP=E4=B8=BALOGIN?= =?UTF-8?q?=5FPAGE=5FENABLE=5FIN=5FMP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复变量名拼写错误,将WP改为MP以准确表示小程序(mini program)场景 --- src/pages/login/README.md | 2 +- src/router/README.md | 2 +- src/router/config.ts | 2 +- src/router/interceptor.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/login/README.md b/src/pages/login/README.md index 2fe4e92..c851a76 100644 --- a/src/pages/login/README.md +++ b/src/pages/login/README.md @@ -9,7 +9,7 @@ 但是如果您的小程序也需要现实的 `登录页` 那也是可以使用的。 -在 `src/router/config.ts` 中有一个变量 `LOGIN_PAGE_ENABLE_IN_WP` 来控制是否在小程序中使用 `H5的登录页`。 +在 `src/router/config.ts` 中有一个变量 `LOGIN_PAGE_ENABLE_IN_MP` 来控制是否在小程序中使用 `H5的登录页`。 更多信息请看 `src/router` 文件夹的内容。 diff --git a/src/router/README.md b/src/router/README.md index 2f6f0a0..b6a6994 100644 --- a/src/router/README.md +++ b/src/router/README.md @@ -52,4 +52,4 @@ definePage({ 特殊情况例外,如业务需要跨平台复用登录注册页时,也可以用在 `小程序` 上,所以主要还是看业务需求。 -通过一个参数 `LOGIN_PAGE_ENABLE_IN_WP` 来控制是否在 `小程序` 中使用 `H5登录页` 的登录逻辑。 +通过一个参数 `LOGIN_PAGE_ENABLE_IN_MP` 来控制是否在 `小程序` 中使用 `H5登录页` 的登录逻辑。 diff --git a/src/router/config.ts b/src/router/config.ts index d0ce80b..b9794ef 100644 --- a/src/router/config.ts +++ b/src/router/config.ts @@ -24,4 +24,4 @@ export const EXCLUDE_LOGIN_PATH_LIST = [ // 在小程序里面是否使用H5的登录页,默认为 false // 如果为 true 则复用 h5 的登录逻辑 -export const LOGIN_PAGE_ENABLE_IN_WP = false +export const LOGIN_PAGE_ENABLE_IN_MP = false diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts index a4aa0a6..3b4d0d9 100644 --- a/src/router/interceptor.ts +++ b/src/router/interceptor.ts @@ -7,7 +7,7 @@ import { isMp } from '@uni-helper/uni-env' import { useTokenStore } from '@/store/token' import { isPageTabbar, tabbarStore } from '@/tabbar/store' import { getAllPages, getLastPage, HOME_PAGE, parseUrlToObj } from '@/utils/index' -import { EXCLUDE_LOGIN_PATH_LIST, isNeedLoginMode, LOGIN_PAGE, LOGIN_PAGE_ENABLE_IN_WP } from './config' +import { EXCLUDE_LOGIN_PATH_LIST, isNeedLoginMode, LOGIN_PAGE, LOGIN_PAGE_ENABLE_IN_MP } from './config' export const FG_LOG_ENABLE = false export function judgeIsExcludePath(path: string) { @@ -47,7 +47,7 @@ export const navigateToInterceptor = { tabbarStore.setAutoCurIdx(path) // 小程序里面使用平台自带的登录,则不走下面的逻辑 - if (isMp && LOGIN_PAGE_ENABLE_IN_WP) { + if (isMp && LOGIN_PAGE_ENABLE_IN_MP) { return true // 明确表示允许路由继续执行 }