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 @@ 成长档案 + + + 个人信息 +