import { createRouter, createWebHistory } from 'vue-router'
|
import { useAppStore } from '../stores/app'
|
import AdminLayout from '../layouts/AdminLayout.vue'
|
|
const familyCardView = () => import('../views/FamilyCardView.vue')
|
const businessManagementView = () => import('../views/BusinessManagementView.vue')
|
const cardPlaceholderView = () => import('../views/CardPlaceholderView.vue')
|
|
const router = createRouter({
|
history: createWebHistory(),
|
routes: [
|
{
|
path: '/login',
|
name: 'login',
|
component: () => import('../views/LoginView.vue'),
|
meta: { public: true },
|
},
|
{
|
path: '/',
|
component: AdminLayout,
|
redirect: '/dashboard',
|
children: [
|
{
|
path: 'dashboard',
|
name: 'dashboard',
|
component: () => import('../views/DashboardView.vue'),
|
meta: { title: '首页' },
|
},
|
{
|
path: 'talents',
|
name: 'talents',
|
component: () => import('../views/TalentListView.vue'),
|
meta: { title: '持卡人管理' },
|
},
|
{
|
path: 'talents/new',
|
name: 'talent-create',
|
component: () => import('../views/TalentCreateView.vue'),
|
meta: { title: '新增持卡人' },
|
},
|
{
|
path: 'talents/:id',
|
name: 'talent-detail',
|
component: () => import('../views/TalentDetailView.vue'),
|
meta: { title: '持卡人详情' },
|
},
|
{
|
path: 'family-card-applications',
|
name: 'family-card-applications',
|
component: familyCardView,
|
props: { mode: 'application' },
|
meta: { title: '家属卡申请' },
|
},
|
{
|
path: 'family-card-applications/:id',
|
name: 'family-card-application-detail',
|
component: () => import('../views/FamilyCardApplicationDetailView.vue'),
|
meta: { title: '家属卡申请详情' },
|
},
|
{
|
path: 'upgrade-applications',
|
name: 'upgrade-applications',
|
component: businessManagementView,
|
meta: { title: '升级申请' },
|
},
|
{
|
path: 'upgrade-applications/:id',
|
name: 'upgrade-application-detail',
|
component: () => import('../views/UpgradeApplicationDetailView.vue'),
|
meta: { title: '升级申请详情' },
|
},
|
{
|
path: 'family-cards',
|
name: 'family-cards',
|
component: familyCardView,
|
props: { mode: 'management' },
|
meta: { title: '家属卡管理' },
|
},
|
{
|
path: 'family-cards/:id',
|
name: 'family-card-detail',
|
component: () => import('../views/FamilyCardApplicationDetailView.vue'),
|
meta: { title: '家属卡详情' },
|
},
|
{
|
path: 'child-cards',
|
name: 'child-cards',
|
component: () => import('../views/ChildCardView.vue'),
|
meta: { title: '子女管理' },
|
},
|
{
|
path: 'child-cards/:id',
|
name: 'child-card-detail',
|
component: () => import('../views/ChildCardApplicationDetailView.vue'),
|
meta: { title: '子女详情' },
|
},
|
{
|
path: 'merchants',
|
name: 'merchants',
|
component: () => import('../views/MerchantView.vue'),
|
meta: { title: '商家查询' },
|
},
|
{
|
path: 'merchants/new',
|
name: 'merchant-create',
|
component: () => import('../views/MerchantCreateView.vue'),
|
meta: { title: '商家管理' },
|
},
|
{
|
path: 'merchant-settlement',
|
name: 'merchant-settlement',
|
component: () => import('../views/MerchantSettlementView.vue'),
|
meta: { title: '提现管理' },
|
},
|
{
|
path: 'merchant-onboardings/:id',
|
name: 'merchant-onboarding-detail',
|
component: () => import('../views/MerchantOnboardingDetailView.vue'),
|
meta: { title: '商户进件详情' },
|
},
|
{
|
path: 'products',
|
name: 'products',
|
component: () => import('../views/ProductView.vue'),
|
meta: { title: '团单审核' },
|
},
|
{
|
path: 'products/:id',
|
name: 'product-audit-detail',
|
component: () => import('../views/ProductAuditDetailView.vue'),
|
meta: { title: '团单审核详情' },
|
},
|
{
|
path: 'orders',
|
name: 'orders',
|
component: () => import('../views/OrderView.vue'),
|
meta: { title: '订单列表' },
|
},
|
{
|
path: 'orders/:orderNo',
|
name: 'order-detail',
|
component: () => import('../views/OrderDetailView.vue'),
|
meta: { title: '订单详情' },
|
},
|
{
|
path: 'refund-records',
|
name: 'refund-records',
|
component: () => import('../views/RefundRecordView.vue'),
|
meta: { title: '退款记录' },
|
},
|
{
|
path: 'hotel-free-verifications',
|
name: 'hotel-free-verifications',
|
component: () => import('../views/HotelVerificationView.vue'),
|
meta: { title: '酒店免费核销记录' },
|
},
|
{
|
path: 'appointment-management',
|
name: 'appointment-management',
|
component: cardPlaceholderView,
|
meta: { title: '预约服务管理', businessKind: 'appointmentManagement' },
|
},
|
{
|
path: 'medical-reservations',
|
name: 'medical-reservations',
|
component: () => import('../views/MedicalReservationView.vue'),
|
meta: { title: '体检预约管理' },
|
},
|
{
|
path: 'medical-reservations/:id',
|
name: 'medical-reservation-detail',
|
component: () => import('../views/MedicalReservationDetailView.vue'),
|
meta: { title: '体检预约详情' },
|
},
|
{
|
path: 'medical-applications',
|
name: 'medical-applications',
|
component: () => import('../views/MedicalApplicationView.vue'),
|
meta: { title: '就医申请管理' },
|
},
|
{
|
path: 'medical-applications/:id',
|
name: 'medical-application-detail',
|
component: () => import('../views/MedicalApplicationDetailView.vue'),
|
meta: { title: '就医申请详情' },
|
},
|
{
|
path: 'parking-plates',
|
name: 'parking-plates',
|
component: () => import('../views/ParkingPlateView.vue'),
|
meta: { title: '停车车牌管理' },
|
},
|
{
|
path: 'parking-plates/:id',
|
name: 'parking-plate-detail',
|
component: () => import('../views/ParkingPlateDetailView.vue'),
|
meta: { title: '停车车牌详情' },
|
},
|
{
|
path: 'car-wash-benefits',
|
name: 'car-wash-benefits',
|
component: cardPlaceholderView,
|
meta: { title: '洗车权益管理', businessKind: 'carWashBenefit' },
|
},
|
{
|
path: 'fuel-services',
|
name: 'fuel-services',
|
component: () => import('../views/FuelServiceView.vue'),
|
meta: { title: '加油服务管理' },
|
},
|
{
|
path: 'fuel-services/:id',
|
name: 'fuel-service-detail',
|
component: () => import('../views/FuelServiceDetailView.vue'),
|
meta: { title: '加油服务详情' },
|
},
|
{
|
path: 'spouse-employment',
|
name: 'spouse-employment',
|
component: () => import('../views/SpouseEmploymentView.vue'),
|
meta: { title: '配偶就业管理' },
|
},
|
{
|
path: 'spouse-employment/:id',
|
name: 'spouse-employment-detail',
|
component: () => import('../views/SpouseEmploymentDetailView.vue'),
|
meta: { title: '配偶就业详情' },
|
},
|
{
|
path: 'hotel-reservations',
|
name: 'hotel-reservations',
|
component: () => import('../views/HotelReservationView.vue'),
|
meta: { title: '酒店预约管理' },
|
},
|
{
|
path: 'hotel-reservations/:id',
|
name: 'hotel-reservation-detail',
|
component: () => import('../views/HotelReservationDetailView.vue'),
|
meta: { title: '酒店预约详情' },
|
},
|
{
|
path: 'benefit-coupons',
|
name: 'benefit-coupons',
|
component: cardPlaceholderView,
|
meta: { title: '优惠券管理', businessKind: 'benefitCoupons' },
|
},
|
{
|
path: 'display-services',
|
name: 'display-services',
|
component: cardPlaceholderView,
|
meta: { title: '展示类服务管理', businessKind: 'displayServices' },
|
},
|
{
|
path: 'equity-images',
|
name: 'equity-images',
|
component: () => import('../views/EquityImageView.vue'),
|
meta: { title: '权益图片管理' },
|
},
|
{
|
path: 'talent-news-management',
|
name: 'talent-news-management',
|
component: () => import('../views/TalentArticleManagementView.vue'),
|
meta: { title: '人才资讯管理' },
|
},
|
{
|
path: 'talent-news',
|
name: 'talent-news',
|
component: () => import('../views/TalentNewsPublishView.vue'),
|
meta: { title: '人才资讯发布' },
|
},
|
{
|
path: 'talent-news-categories/:id',
|
name: 'talent-news-categories',
|
component: () => import('../views/TalentNewsEditView.vue'),
|
meta: { title: '人才资讯编辑' },
|
},
|
{
|
path: 'talent-policy-management',
|
name: 'talent-policy-management',
|
component: () => import('../views/TalentArticleManagementView.vue'),
|
meta: { title: '人才政策管理', businessKind: 'talentPolicyHome' },
|
},
|
{
|
path: 'talent-policies',
|
name: 'talent-policies',
|
component: () => import('../views/TalentPolicyPublishView.vue'),
|
meta: { title: '人才政策发布' },
|
},
|
{
|
path: 'talent-policy-categories/:id',
|
name: 'talent-policy-categories',
|
component: () => import('../views/TalentPolicyEditView.vue'),
|
meta: { title: '人才政策编辑' },
|
},
|
{
|
path: 'movie-tickets',
|
name: 'movie-tickets',
|
component: () => import('../views/MovieTicketView.vue'),
|
meta: { title: '电影票管理' },
|
},
|
{
|
path: 'movie-ticket-records',
|
name: 'movie-ticket-records',
|
component: () => import('../views/MovieTicketRecordView.vue'),
|
meta: { title: '电影票记录' },
|
},
|
{
|
path: 'system-settings',
|
name: 'system-settings',
|
component: () => import('../views/PlatformSettingsView.vue'),
|
meta: { title: '平台设置' },
|
},
|
{
|
path: 'protocol-settings',
|
name: 'protocol-settings',
|
component: () => import('../views/ProtocolSettingsView.vue'),
|
meta: { title: '协议设置' },
|
},
|
{
|
path: 'roles',
|
name: 'roles',
|
component: businessManagementView,
|
meta: { title: '角色管理', businessKind: 'role' },
|
},
|
{
|
path: 'roles/new',
|
name: 'role-create',
|
component: () => import('../views/RoleFormView.vue'),
|
meta: { title: '新增角色' },
|
},
|
{
|
path: 'roles/:id',
|
name: 'role-edit',
|
component: () => import('../views/RoleFormView.vue'),
|
meta: { title: '编辑角色' },
|
},
|
{
|
path: 'staff',
|
name: 'staff',
|
component: () => import('../views/StaffManagementView.vue'),
|
meta: { title: '员工管理' },
|
},
|
],
|
},
|
],
|
})
|
|
router.beforeEach((to) => {
|
const appStore = useAppStore()
|
if (!to.meta.public && !appStore.token) {
|
return '/login'
|
}
|
return true
|
})
|
|
export default router
|