重构Salon管理员后台入口
This commit is contained in:
@@ -9,17 +9,8 @@ import {
|
||||
|
||||
const pageNames = [
|
||||
['', 'HomeView', 'admin', undefined], ['dashboard', 'DashboardView', 'admin-dashboard', 'dashboard:view'],
|
||||
['users', 'UsersView', 'admin-users', 'user:view'], ['products', 'ProductsView', 'admin-products', 'product:view'],
|
||||
['coupons', 'CouponsView', 'admin-coupons', 'coupon:view'], ['comments', 'CommentsView', 'admin-comments', 'comment:view'],
|
||||
['shops', 'ShopsView', 'admin-shops', 'shop:view'], ['permissions', 'PermissionsView', 'admin-permissions', 'permission:view'],
|
||||
['orders', 'OrdersView', 'admin-orders', 'order:view'], ['schedules', 'SchedulesView', 'admin-schedules', 'schedule:view'],
|
||||
['after-sales', 'AfterSalesView', 'admin-after-sales', 'after_sale:view'], ['inventory', 'InventoryView', 'admin-inventory', 'inventory:view'],
|
||||
['campaigns', 'CampaignsView', 'admin-campaigns', 'campaign:view'], ['manage', 'ManageView', 'admin-manage', undefined],
|
||||
['profile', 'ProfileView', 'admin-profile', undefined], ['tags', 'TagsView', 'admin-tags', 'tag:view'],
|
||||
['nail-artists', 'NailArtistsView', 'admin-nail-artists', 'nail_artist:view'], ['messages', 'SystemMessagesView', 'admin-messages', 'message:view'],
|
||||
['announcements', 'AnnouncementsView', 'admin-announcements', 'announcement:view'], ['vip-recharge-plans', 'VipRechargePlansView', 'admin-vip-recharge-plans', 'user:vip:manage'],
|
||||
['messagehub-push-configs', 'MessageHubPushConfigsView', 'admin-messagehub-push-configs', 'messagehub:config:manage'],
|
||||
['legal-agreements', 'LegalAgreementsView', 'admin-legal-agreements', 'legal_agreement:manage']
|
||||
['users', 'UsersView', 'admin-users', 'user:view'], ['shops', 'ShopsView', 'admin-shops', 'shop:view'],
|
||||
['profile', 'ProfileView', 'admin-profile', undefined]
|
||||
] as const
|
||||
|
||||
const routes = [
|
||||
@@ -42,6 +33,10 @@ router.beforeEach(async to => {
|
||||
if (!snapshot.token || !snapshot.userInfo) return true
|
||||
return (await ensureAdminAuthBootstrap()) === 'ready' ? resolveAdminLandingPath() : true
|
||||
}
|
||||
if (!snapshot.isPlatformAdmin) {
|
||||
clearAdminBootstrapSession()
|
||||
return '/admin/login'
|
||||
}
|
||||
if (!snapshot.token || !snapshot.userInfo) {
|
||||
clearAdminBootstrapSession()
|
||||
return '/admin/login'
|
||||
|
||||
Reference in New Issue
Block a user