This commit is contained in:
2026-06-13 07:33:46 +08:00
parent e2da13bc5c
commit 24017e7454
40 changed files with 3135 additions and 108 deletions
+104 -25
View File
@@ -13,36 +13,115 @@ const routes: RouteRecordRaw[] = [
],
},
// ==================== 聊天主界面(套用 ChatLayout=====================
// ==================== 主界面(统一布局=====================
{
path: '/',
component: () => import('@/layouts/ChatLayout.vue'),
component: () => import('@/layouts/UnifiedLayout.vue'),
meta: { requiresAuth: true },
children: [
// 聊天
{
path: 'chat',
children: [
{
path: '',
name: 'ChatList',
components: {
secondary: () => import('@/views/chat/ConversationListPanel.vue'),
default: () => import('@/views/chat/ChatListView.vue'),
},
},
{
path: ':id',
name: 'ChatRoom',
meta: { hideSecondary: true },
components: {
secondary: () => import('@/views/chat/ConversationListPanel.vue'),
default: () => import('@/views/chat/ChatRoomView.vue'),
},
},
],
},
// 通讯录
{
path: 'contacts',
children: [
{
path: '',
name: 'Contacts',
components: {
secondary: () => import('@/views/contacts/ContactsSidebar.vue'),
default: () => import('@/views/contacts/ContactsView.vue'),
},
},
{
path: 'search',
name: 'Search',
components: {
secondary: () => import('@/views/contacts/ContactsSidebar.vue'),
default: () => import('@/views/contacts/SearchView.vue'),
},
},
],
},
// 朋友圈
{
path: 'moments',
name: 'Moments',
components: {
secondary: () => import('@/views/moments/MomentsFeedView.vue'),
default: () => import('@/views/moments/MomentsFeedView.vue'),
},
},
// 设置
{
path: 'settings',
children: [
{
path: '',
redirect: '/settings/profile',
},
{
path: 'profile',
name: 'SettingsProfile',
components: {
secondary: () => import('@/views/settings/SettingsSidebar.vue'),
default: () => import('@/views/settings/ProfileSettingsView.vue'),
},
},
{
path: 'account',
name: 'SettingsAccount',
components: {
secondary: () => import('@/views/settings/SettingsSidebar.vue'),
default: () => import('@/views/settings/AccountSettingsView.vue'),
},
},
{
path: 'notifications',
name: 'SettingsNotifications',
components: {
secondary: () => import('@/views/settings/SettingsSidebar.vue'),
default: () => import('@/views/settings/NotificationSettingsView.vue'),
},
},
{
path: 'about',
name: 'SettingsAbout',
components: {
secondary: () => import('@/views/settings/SettingsSidebar.vue'),
default: () => import('@/views/settings/AboutView.vue'),
},
},
],
},
// 根路径重定向
{ path: '', redirect: '/chat' },
{ path: 'chat', name: 'ChatList', component: () => import('@/views/chat/ChatListView.vue') },
{ path: 'chat/:id', name: 'ChatRoom', component: () => import('@/views/chat/ChatRoomView.vue') },
],
},
// ==================== 通讯录(套用 MainLayout=====================
{
path: '/contacts',
component: () => import('@/layouts/MainLayout.vue'),
meta: { requiresAuth: true },
children: [
{ path: '', name: 'Contacts', component: () => import('@/views/contacts/ContactsView.vue') },
{ path: 'search', name: 'Search', component: () => import('@/views/contacts/SearchView.vue') },
],
},
// ==================== 个人中心 =====================
{
path: '/profile',
component: () => import('@/layouts/MainLayout.vue'),
meta: { requiresAuth: true },
children: [
{ path: '', name: 'Profile', component: () => import('@/views/profile/ProfileView.vue') },
{ path: 'profile', redirect: '/settings/profile' },
],
},