1404/10/28-base
This commit is contained in:
@@ -0,0 +1,203 @@
|
||||
import {createRouter, createWebHistory} from 'vue-router'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: `/login`,
|
||||
name: 'login',
|
||||
component: () => import('../views/login/index.vue')
|
||||
},
|
||||
/* {
|
||||
path: '/',
|
||||
name: 'null',
|
||||
redirect: {name: 'home'},
|
||||
// component: () => import('../views/login/index.vue')
|
||||
},*/
|
||||
{
|
||||
path: `/`,
|
||||
name: 'main',
|
||||
redirect: {name: 'login'},
|
||||
component: () => import('../views/base/index.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
name: 'home',
|
||||
component: () => import('../views/base/home/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'gold',
|
||||
name: 'gold',
|
||||
component: () => import('@/views/base/gold/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'buyProduct',
|
||||
name: 'buyProduct',
|
||||
component: () => import('@/views/base/products/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'transactions',
|
||||
name: 'transactions',
|
||||
component: () => import('@/views/base/transactions/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'wallet',
|
||||
name: 'wallet',
|
||||
component: () => import('../views/base/wallet/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
name: 'user',
|
||||
component: () => import('../views/base/user/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'about',
|
||||
name: 'about',
|
||||
component: () => import('@/views/base/about/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'notifyTrigger',
|
||||
name: 'notifyTrigger',
|
||||
component: () => import('@/views/base/priceTrigger/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'address',
|
||||
name: 'address',
|
||||
component: () => import('@/views/base/address/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'physicalReceive',
|
||||
name: 'physicalReceive',
|
||||
redirect:{name: 'list'},
|
||||
component: () => import('@/views/base/physicalReceive/index.vue'),
|
||||
children:[
|
||||
{
|
||||
path: '',
|
||||
name: 'list',
|
||||
component: () => import('@/views/base/physicalReceive/components/RequestList.vue')
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
name: 'new',
|
||||
component: () => import('@/views/base/physicalReceive/components/NewRequest.vue')
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'rules',
|
||||
name: 'rules',
|
||||
component: () => import('@/views/base/rules/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'permissions',
|
||||
name: 'permissions',
|
||||
component: () => import('@/views/base/rules/permissions/permissions.vue')
|
||||
},
|
||||
{
|
||||
path: 'earnMoney',
|
||||
name: 'earnMoney',
|
||||
component: () => import('@/views/base/earnMoney/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'fund',
|
||||
name: 'fund',
|
||||
component: () => import('@/views/base/fund/index.vue'),
|
||||
children: []
|
||||
},
|
||||
{
|
||||
path: 'fund/:id',
|
||||
name: 'fund_info',
|
||||
component: () => import('@/views/base/fund/info/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'fund/add',
|
||||
name: 'fund_add',
|
||||
component: () => import('@/views/base/fund/newFund/index.vue')
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
name: 'notFound',
|
||||
redirect: {name: '404'},
|
||||
meta: {
|
||||
hideMenu: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/404`,
|
||||
name: '404',
|
||||
component: () => import('../views/base/404.vue')
|
||||
},
|
||||
|
||||
/* {
|
||||
path: `/single/login`,
|
||||
name: 'login',
|
||||
component: () => import('../views/login/index.vue')
|
||||
},
|
||||
{
|
||||
path: `/single/`,
|
||||
name: 'single_main',
|
||||
redirect: {name: 'login'},
|
||||
component: () => import('../views/base/index.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
name: 'home',
|
||||
component: () => import('../views/base/home/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'gold',
|
||||
name: 'gold',
|
||||
component: () => import('@/views/base/gold/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'transactions',
|
||||
name: 'transactions',
|
||||
component: () => import('@/views/base/transactions/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'wallet',
|
||||
name: 'wallet',
|
||||
component: () => import('../views/base/wallet/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
name: 'user',
|
||||
component: () => import('../views/base/user/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'fund',
|
||||
name: 'fund',
|
||||
component: () => import('@/views/base/fund/index.vue'),
|
||||
children: []
|
||||
},
|
||||
{
|
||||
path: 'fund/:id',
|
||||
name: 'fund_info',
|
||||
component: () => import('@/views/base/fund/info/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'fund/add',
|
||||
name: 'fund_add',
|
||||
component: () => import('@/views/base/fund/newFund/index.vue')
|
||||
},
|
||||
]
|
||||
},*/
|
||||
]
|
||||
})
|
||||
|
||||
router.afterEach((to, from) => {
|
||||
/* const toDepth = to.path.split('/').length
|
||||
const fromDepth = from.path.split('/').length
|
||||
to.meta.transition = toDepth < fromDepth ? 'slide-right' : 'slide-left'*/
|
||||
/* if (to.name === 'home' && (from.name === 'wallet' || from.name === 'transactions' || from.name === 'gold')) {
|
||||
to.meta.transition = 'slide-left'
|
||||
}
|
||||
if (to.name === 'wallet' && (from.name === 'home' || from.name === 'transactions' || from.name === 'gold')) {
|
||||
to.meta.transition = 'slide-right'
|
||||
}*/
|
||||
// console.log(to)
|
||||
})
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user