From f25664cf9a4e0a610a7a30aae02d7498ed2a9e7c Mon Sep 17 00:00:00 2001 From: zhonghua Date: Mon, 16 Mar 2026 15:04:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=90=84=E7=AB=AF?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 ProfileView 共享个人信息页面 - 扩展 auth API UserProfile 支持各角色 - 为 admin/school/teacher/parent 添加 profile 路由 - 各端 Layout 用户菜单增加个人信息入口及跳转 - 家长端移动版抽屉菜单增加个人信息入口 Made-with: Cursor --- reading-platform-frontend/src/api/auth.ts | 4 +- reading-platform-frontend/src/components.d.ts | 2 +- reading-platform-frontend/src/router/index.ts | 24 +++ .../src/views/admin/LayoutView.vue | 4 +- .../src/views/parent/LayoutView.vue | 17 ++- .../src/views/profile/ProfileView.vue | 140 ++++++++++++++++++ .../src/views/school/LayoutView.vue | 4 +- .../src/views/teacher/LayoutView.vue | 4 +- reading-platform-frontend/typed-router.d.ts | 13 ++ 9 files changed, 206 insertions(+), 6 deletions(-) create mode 100644 reading-platform-frontend/src/views/profile/ProfileView.vue diff --git a/reading-platform-frontend/src/api/auth.ts b/reading-platform-frontend/src/api/auth.ts index b4c549d..fc89bdd 100644 --- a/reading-platform-frontend/src/api/auth.ts +++ b/reading-platform-frontend/src/api/auth.ts @@ -21,13 +21,15 @@ export interface LoginResponse { export interface UserProfile { id: number; + username?: string; name: string; - role: 'admin' | 'school' | 'teacher'; + role: 'admin' | 'school' | 'teacher' | 'parent'; tenantId?: number; tenantName?: string; email?: string; phone?: string; avatar?: string; + avatarUrl?: string; } // 登录 diff --git a/reading-platform-frontend/src/components.d.ts b/reading-platform-frontend/src/components.d.ts index 330abbb..060b0c7 100644 --- a/reading-platform-frontend/src/components.d.ts +++ b/reading-platform-frontend/src/components.d.ts @@ -11,6 +11,7 @@ declare module 'vue' { AAvatar: typeof import('ant-design-vue/es')['Avatar'] ABadge: typeof import('ant-design-vue/es')['Badge'] AButton: typeof import('ant-design-vue/es')['Button'] + AButtonGroup: typeof import('ant-design-vue/es')['ButtonGroup'] ACard: typeof import('ant-design-vue/es')['Card'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup'] @@ -49,7 +50,6 @@ declare module 'vue' { ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup'] ARangePicker: typeof import('ant-design-vue/es')['RangePicker'] ARate: typeof import('ant-design-vue/es')['Rate'] - AResult: typeof import('ant-design-vue/es')['Result'] ARow: typeof import('ant-design-vue/es')['Row'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOptGroup: typeof import('ant-design-vue/es')['SelectOptGroup'] diff --git a/reading-platform-frontend/src/router/index.ts b/reading-platform-frontend/src/router/index.ts index 1b5d0a1..16858d6 100644 --- a/reading-platform-frontend/src/router/index.ts +++ b/reading-platform-frontend/src/router/index.ts @@ -118,6 +118,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/views/admin/SettingsView.vue'), meta: { title: '系统设置' }, }, + { + path: 'profile', + name: 'AdminProfile', + component: () => import('@/views/profile/ProfileView.vue'), + meta: { title: '个人信息' }, + }, ], }, { @@ -262,6 +268,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/views/school/settings/SettingsView.vue'), meta: { title: '系统设置' }, }, + { + path: 'profile', + name: 'SchoolProfile', + component: () => import('@/views/profile/ProfileView.vue'), + meta: { title: '个人信息' }, + }, ], }, { @@ -382,6 +394,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/views/teacher/growth/GrowthRecordView.vue'), meta: { title: '成长档案' }, }, + { + path: 'profile', + name: 'TeacherProfile', + component: () => import('@/views/profile/ProfileView.vue'), + meta: { title: '个人信息' }, + }, ], }, { @@ -429,6 +447,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/views/parent/growth/GrowthRecordView.vue'), meta: { title: '成长档案' }, }, + { + path: 'profile', + name: 'ParentProfile', + component: () => import('@/views/profile/ProfileView.vue'), + meta: { title: '个人信息' }, + }, ], }, { diff --git a/reading-platform-frontend/src/views/admin/LayoutView.vue b/reading-platform-frontend/src/views/admin/LayoutView.vue index 83c5d60..105d668 100644 --- a/reading-platform-frontend/src/views/admin/LayoutView.vue +++ b/reading-platform-frontend/src/views/admin/LayoutView.vue @@ -174,6 +174,8 @@ watch( selectedKeys.value = ['resources']; } else if (path.startsWith('/admin/settings')) { selectedKeys.value = ['settings']; + } else if (path.startsWith('/admin/profile')) { + selectedKeys.value = []; } else { selectedKeys.value = ['dashboard']; } @@ -203,7 +205,7 @@ const handleUserMenuClick = ({ key }: { key: string | number }) => { if (keyStr === 'logout') { userStore.logout(); } else if (keyStr === 'profile') { - // 跳转到个人信息页面 + router.push('/admin/profile'); } }; diff --git a/reading-platform-frontend/src/views/parent/LayoutView.vue b/reading-platform-frontend/src/views/parent/LayoutView.vue index 4bb7f34..a4ac136 100644 --- a/reading-platform-frontend/src/views/parent/LayoutView.vue +++ b/reading-platform-frontend/src/views/parent/LayoutView.vue @@ -95,6 +95,10 @@ 成长档案 + + + 个人信息 +