From 61fc140e768429bd444f8cf12e96c2e1949ace79 Mon Sep 17 00:00:00 2001
From: feige996 <1020102647@qq.com>
Date: Thu, 2 Oct 2025 10:25:47 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E8=B7=AF=E7=94=B1=E5=92=8C=E5=AF=BC=E8=88=AA=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
移除关于页面的相关路由配置,更新页面跳转路径
修正组件文档说明,更新登录排除路径示例
---
scripts/create-base-files.js | 33 ----------------------
src/pages-sub/about/about.vue | 2 +-
src/pages-sub/about/components/request.vue | 2 +-
src/router/config.ts | 3 +-
4 files changed, 4 insertions(+), 36 deletions(-)
diff --git a/scripts/create-base-files.js b/scripts/create-base-files.js
index 7794f88..0cf31cc 100644
--- a/scripts/create-base-files.js
+++ b/scripts/create-base-files.js
@@ -159,10 +159,6 @@ const pages = {
text: '首页',
pagePath: 'pages/index/index',
},
- {
- text: '关于',
- pagePath: 'pages/about/about',
- },
{
text: '我的',
pagePath: 'pages/me/me',
@@ -178,35 +174,6 @@ const pages = {
navigationBarTitleText: '首页',
},
},
- {
- path: 'pages/about/about',
- type: 'page',
- style: {
- navigationBarTitleText: '关于',
- },
- excludeLoginPath: false,
- },
- {
- path: 'pages/about/alova',
- type: 'page',
- style: {
- navigationBarTitleText: 'Alova 演示',
- },
- },
- {
- path: 'pages/login/login',
- type: 'page',
- style: {
- navigationBarTitleText: '登录',
- },
- },
- {
- path: 'pages/login/register',
- type: 'page',
- style: {
- navigationBarTitleText: '注册',
- },
- },
{
path: 'pages/me/me',
type: 'page',
diff --git a/src/pages-sub/about/about.vue b/src/pages-sub/about/about.vue
index 63e00f3..005200d 100644
--- a/src/pages-sub/about/about.vue
+++ b/src/pages-sub/about/about.vue
@@ -49,7 +49,7 @@ function gotoScroll() {
function gotoAlova() {
uni.navigateTo({
- url: '/pages/about/alova',
+ url: '/pages-sub/about/alova',
})
}
function gotoSubPage() {
diff --git a/src/pages-sub/about/components/request.vue b/src/pages-sub/about/components/request.vue
index 18f8582..73db16b 100644
--- a/src/pages-sub/about/components/request.vue
+++ b/src/pages-sub/about/components/request.vue
@@ -37,7 +37,7 @@ function reset() {
pages 里面的 vue 文件会扫描成页面,将自动添加到 pages.json 里面。
- 但是 pages/components 里面的 vue 不会。
+ 但是 components 里面的 vue 不会。
diff --git a/src/router/config.ts b/src/router/config.ts
index 341fa38..2d0e52d 100644
--- a/src/router/config.ts
+++ b/src/router/config.ts
@@ -20,7 +20,8 @@ export const excludeLoginPathList = getAllPages('excludeLoginPath').map(page =>
// 排除在外的列表,白名单策略指白名单列表,黑名单策略指黑名单列表
// TODO: 2/3 在 definePage 配置 excludeLoginPath,或者在下面配置 EXCLUDE_LOGIN_PATH_LIST
export const EXCLUDE_LOGIN_PATH_LIST = [
- '/pages/xxx/index',
+ '/pages/xxx/index', // 示例值
+ '/pages-sub/xxx/index', // 示例值
...excludeLoginPathList, // 都是以 / 开头的 path
]