chore: 更新路由配置,使用 features 架构路径

This commit is contained in:
yml2213
2026-06-04 09:12:36 +08:00
parent d5abb99ebf
commit 3d5db9d0b6
6 changed files with 43 additions and 43 deletions
+10 -10
View File
@@ -4,60 +4,60 @@ export const accountRoutes: RouteRecordRaw[] = [
{ {
path: '/login', path: '/login',
name: 'login', name: 'login',
component: () => import('@/views/account/LoginView.vue'), component: () => import('@/features/auth/views/LoginView.vue'),
}, },
{ {
path: '/orders/create', path: '/orders/create',
name: 'order-create', name: 'order-create',
component: () => import('@/views/account/OrderCreateView.vue'), component: () => import('@/features/orders/views/OrderCreateView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/profile', path: '/profile',
name: 'profile', name: 'profile',
component: () => import('@/views/account/ProfileView.vue'), component: () => import('@/features/auth/views/ProfileView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/orders', path: '/orders',
name: 'orders', name: 'orders',
component: () => import('@/views/account/OrdersView.vue'), component: () => import('@/features/orders/views/OrdersView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/orders/:id', path: '/orders/:id',
name: 'order-detail', name: 'order-detail',
component: () => import('@/views/account/OrderDetailView.vue'), component: () => import('@/features/orders/views/OrderDetailView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/wallet', path: '/wallet',
name: 'wallet', name: 'wallet',
component: () => import('@/views/account/WalletView.vue'), component: () => import('@/features/wallet/views/WalletView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/notifications', path: '/notifications',
name: 'notifications', name: 'notifications',
component: () => import('@/views/account/NotificationsView.vue'), component: () => import('@/features/auth/views/NotificationsView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/realname', path: '/realname',
name: 'realname', name: 'realname',
component: () => import('@/views/account/RealnameView.vue'), component: () => import('@/features/auth/views/RealnameView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/messages', path: '/messages',
name: 'messages', name: 'messages',
component: () => import('@/views/account/MessagesView.vue'), component: () => import('@/features/chats/views/MessagesView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/messages/:id', path: '/messages/:id',
name: 'chat', name: 'chat',
component: () => import('@/views/account/ChatView.vue'), component: () => import('@/features/chats/views/ChatView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
] ]
+15 -15
View File
@@ -7,91 +7,91 @@ export const adminRoutes: RouteRecordRaw[] = [
{ {
path: '/admin/login', path: '/admin/login',
name: 'admin-login', name: 'admin-login',
component: () => import('@/views/admin/AdminLoginView.vue'), component: () => import('@/features/admin/views/AdminLoginView.vue'),
meta: { layout: 'blank' }, meta: { layout: 'blank' },
}, },
{ {
path: '/admin/dashboard', path: '/admin/dashboard',
name: 'admin-dashboard', name: 'admin-dashboard',
component: () => import('@/views/admin/AdminDashboardView.vue'), component: () => import('@/features/admin/views/AdminDashboardView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/users', path: '/admin/users',
name: 'admin-users', name: 'admin-users',
component: () => import('@/views/admin/AdminUsersView.vue'), component: () => import('@/features/admin/views/AdminUsersView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/orders', path: '/admin/orders',
name: 'admin-orders', name: 'admin-orders',
component: () => import('@/views/admin/AdminOrdersView.vue'), component: () => import('@/features/admin/views/AdminOrdersView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/orders/:id', path: '/admin/orders/:id',
name: 'admin-order-detail', name: 'admin-order-detail',
component: () => import('@/views/admin/AdminOrderDetailView.vue'), component: () => import('@/features/admin/views/AdminOrderDetailView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/listings', path: '/admin/listings',
name: 'admin-listings', name: 'admin-listings',
component: () => import('@/views/admin/AdminListingsView.vue'), component: () => import('@/features/admin/views/AdminListingsView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/listings/:id', path: '/admin/listings/:id',
name: 'admin-listing-detail', name: 'admin-listing-detail',
component: () => import('@/views/admin/AdminListingDetailView.vue'), component: () => import('@/features/admin/views/AdminListingDetailView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/listings/review', path: '/admin/listings/review',
name: 'admin-listing-review', name: 'admin-listing-review',
component: () => import('@/views/admin/AdminListingReviewView.vue'), component: () => import('@/features/admin/views/AdminListingReviewView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/disputes', path: '/admin/disputes',
name: 'admin-disputes', name: 'admin-disputes',
component: () => import('@/views/admin/AdminDisputesView.vue'), component: () => import('@/features/admin/views/AdminDisputesView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/chats', path: '/admin/chats',
name: 'admin-chats', name: 'admin-chats',
component: () => import('@/views/admin/AdminChatsView.vue'), component: () => import('@/features/admin/views/AdminChatsView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/wallet-ledger', path: '/admin/wallet-ledger',
name: 'admin-wallet-ledger', name: 'admin-wallet-ledger',
component: () => import('@/views/admin/AdminWalletLedgerView.vue'), component: () => import('@/features/admin/views/AdminWalletLedgerView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/system-configs', path: '/admin/system-configs',
name: 'admin-system-configs', name: 'admin-system-configs',
component: () => import('@/views/admin/AdminSystemConfigsView.vue'), component: () => import('@/features/admin/views/AdminSystemConfigsView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/audit-logs', path: '/admin/audit-logs',
name: 'admin-audit-logs', name: 'admin-audit-logs',
component: () => import('@/views/admin/AdminAuditLogsView.vue'), component: () => import('@/features/admin/views/AdminAuditLogsView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/admin-users', path: '/admin/admin-users',
name: 'admin-admin-users', name: 'admin-admin-users',
component: () => import('@/views/admin/AdminMgrUsersView.vue'), component: () => import('@/features/admin/views/AdminMgrUsersView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
{ {
path: '/admin/roles', path: '/admin/roles',
name: 'admin-roles', name: 'admin-roles',
component: () => import('@/views/admin/AdminRolesView.vue'), component: () => import('@/features/admin/views/AdminRolesView.vue'),
meta: adminMeta, meta: adminMeta,
}, },
] ]
+1 -1
View File
@@ -2,7 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router'
import { useAdminSessionStore } from '@/stores/adminSession' import { useAdminSessionStore } from '@/stores/adminSession'
import { useSessionStore } from '@/stores/session' import { useSessionStore } from '@/stores/session'
import { getAccessToken, getLoginPath } from '@/utils/authStorage' import { getAccessToken, getLoginPath } from '@/shared/utils/authStorage'
import { accountRoutes } from './accountRoutes' import { accountRoutes } from './accountRoutes'
import { adminRoutes } from './adminRoutes' import { adminRoutes } from './adminRoutes'
import { isMobileHost, isMobileDevice, getMobilePath, getPcPath } from './mobileHost' import { isMobileHost, isMobileDevice, getMobilePath, getPcPath } from './mobileHost'
+11 -11
View File
@@ -4,67 +4,67 @@ export const mobileRoutes: RouteRecordRaw[] = [
{ {
path: '/m', path: '/m',
name: 'mobile-home', name: 'mobile-home',
component: () => import('@/views/mobile/MobileHomeView.vue'), component: () => import('@/features/listings/views/MobileHomeView.vue'),
meta: { layout: 'blank' }, meta: { layout: 'blank' },
}, },
{ {
path: '/m/listings', path: '/m/listings',
name: 'mobile-listings', name: 'mobile-listings',
component: () => import('@/views/mobile/MobileHomeView.vue'), component: () => import('@/features/listings/views/MobileHomeView.vue'),
meta: { layout: 'blank' }, meta: { layout: 'blank' },
}, },
{ {
path: '/m/listings/:id', path: '/m/listings/:id',
name: 'mobile-listing-detail', name: 'mobile-listing-detail',
component: () => import('@/views/mobile/MobileListingDetailView.vue'), component: () => import('@/features/listings/views/MobileListingDetailView.vue'),
meta: { layout: 'blank' }, meta: { layout: 'blank' },
}, },
{ {
path: '/m/login', path: '/m/login',
name: 'mobile-login', name: 'mobile-login',
component: () => import('@/views/mobile/MobileLoginView.vue'), component: () => import('@/features/auth/views/MobileLoginView.vue'),
meta: { layout: 'blank' }, meta: { layout: 'blank' },
}, },
{ {
path: '/m/register', path: '/m/register',
name: 'mobile-register', name: 'mobile-register',
component: () => import('@/views/mobile/MobileRegisterView.vue'), component: () => import('@/features/auth/views/MobileRegisterView.vue'),
meta: { layout: 'blank' }, meta: { layout: 'blank' },
}, },
{ {
path: '/m/messages', path: '/m/messages',
name: 'mobile-messages', name: 'mobile-messages',
component: () => import('@/views/mobile/MobileMessagesView.vue'), component: () => import('@/features/chats/views/MobileMessagesView.vue'),
meta: { layout: 'blank', requiresAuth: true }, meta: { layout: 'blank', requiresAuth: true },
}, },
{ {
path: '/m/chats/:id', path: '/m/chats/:id',
name: 'mobile-chat', name: 'mobile-chat',
component: () => import('@/views/mobile/MobileChatView.vue'), component: () => import('@/features/chats/views/MobileChatView.vue'),
meta: { layout: 'blank', requiresAuth: true }, meta: { layout: 'blank', requiresAuth: true },
}, },
{ {
path: '/m/realname', path: '/m/realname',
name: 'mobile-realname', name: 'mobile-realname',
component: () => import('@/views/mobile/MobileRealnameView.vue'), component: () => import('@/features/auth/views/MobileRealnameView.vue'),
meta: { layout: 'blank', requiresAuth: true }, meta: { layout: 'blank', requiresAuth: true },
}, },
{ {
path: '/m/profile', path: '/m/profile',
name: 'mobile-profile', name: 'mobile-profile',
component: () => import('@/views/mobile/MobileProfileView.vue'), component: () => import('@/features/auth/views/MobileProfileView.vue'),
meta: { layout: 'blank', requiresAuth: true }, meta: { layout: 'blank', requiresAuth: true },
}, },
{ {
path: '/m/orders', path: '/m/orders',
name: 'mobile-orders', name: 'mobile-orders',
component: () => import('@/views/mobile/MobileOrdersView.vue'), component: () => import('@/features/orders/views/MobileOrdersView.vue'),
meta: { layout: 'blank', requiresAuth: true }, meta: { layout: 'blank', requiresAuth: true },
}, },
{ {
path: '/m/orders/:id', path: '/m/orders/:id',
name: 'mobile-order-detail', name: 'mobile-order-detail',
component: () => import('@/views/mobile/MobileOrderDetailView.vue'), component: () => import('@/features/orders/views/MobileOrderDetailView.vue'),
meta: { layout: 'blank', requiresAuth: true }, meta: { layout: 'blank', requiresAuth: true },
}, },
{ {
+2 -2
View File
@@ -4,11 +4,11 @@ export const publicRoutes: RouteRecordRaw[] = [
{ {
path: '/', path: '/',
name: 'home', name: 'home',
component: () => import('@/views/public/HomeView.vue'), component: () => import('@/features/listings/views/HomeView.vue'),
}, },
{ {
path: '/listings/:id', path: '/listings/:id',
name: 'listing-detail', name: 'listing-detail',
component: () => import('@/views/public/ListingDetailView.vue'), component: () => import('@/features/listings/views/ListingDetailView.vue'),
}, },
] ]
+4 -4
View File
@@ -4,25 +4,25 @@ export const sellerRoutes: RouteRecordRaw[] = [
{ {
path: '/seller/listings', path: '/seller/listings',
name: 'seller-listings', name: 'seller-listings',
component: () => import('@/views/seller/SellerListingsView.vue'), component: () => import('@/features/seller/views/SellerListingsView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/seller/listings/create', path: '/seller/listings/create',
name: 'seller-listing-create', name: 'seller-listing-create',
component: () => import('@/views/seller/SellerListingCreateView.vue'), component: () => import('@/features/seller/views/SellerListingCreateView.vue'),
meta: { requiresAuth: true, requiresRealname: true }, meta: { requiresAuth: true, requiresRealname: true },
}, },
{ {
path: '/seller/handoffs', path: '/seller/handoffs',
name: 'seller-handoffs', name: 'seller-handoffs',
component: () => import('@/views/seller/SellerHandoffsView.vue'), component: () => import('@/features/seller/views/SellerHandoffsView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
{ {
path: '/seller/earnings', path: '/seller/earnings',
name: 'seller-earnings', name: 'seller-earnings',
component: () => import('@/views/seller/SellerEarningsView.vue'), component: () => import('@/features/seller/views/SellerEarningsView.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
}, },
] ]