|
|
@@ -9,7 +9,7 @@ const { getToken } = useLoginStore()
|
|
|
const routes: Array<RouteRecordRaw> = [
|
|
|
{
|
|
|
path: '/:pathMatch(.*)*',
|
|
|
- name: 'error',
|
|
|
+ name: 'Error',
|
|
|
component: () => import('../views/error/404.vue'),
|
|
|
meta: {
|
|
|
ignoreAuth: true,
|
|
|
@@ -17,7 +17,7 @@ const routes: Array<RouteRecordRaw> = [
|
|
|
},
|
|
|
{
|
|
|
path: '/boot',
|
|
|
- name: 'boot',
|
|
|
+ name: 'Boot',
|
|
|
component: () => import('../views/boot/index.vue'),
|
|
|
meta: {
|
|
|
ignoreAuth: true,
|
|
|
@@ -29,62 +29,49 @@ const routes: Array<RouteRecordRaw> = [
|
|
|
children: [
|
|
|
{
|
|
|
path: '',
|
|
|
- name: 'home',
|
|
|
+ name: 'Home',
|
|
|
component: () => import('../views/home/index.vue'),
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- path: '/login',
|
|
|
+ path: '/user',
|
|
|
component: Page,
|
|
|
children: [
|
|
|
{
|
|
|
- path: '',
|
|
|
- name: 'login',
|
|
|
+ path: 'login',
|
|
|
+ name: 'UserLogin',
|
|
|
component: () => import('../views/user/login/index.vue'),
|
|
|
meta: {
|
|
|
ignoreAuth: true,
|
|
|
},
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/logoff',
|
|
|
- component: Page,
|
|
|
- children: [
|
|
|
- {
|
|
|
- path: '',
|
|
|
- name: 'logoff',
|
|
|
- component: () => import('../views/user/logoff/index.vue'),
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/register',
|
|
|
- component: Page,
|
|
|
- children: [
|
|
|
+ },
|
|
|
{
|
|
|
- path: '',
|
|
|
- name: 'register',
|
|
|
+ path: 'register',
|
|
|
+ name: 'UserRegister',
|
|
|
component: () => import('../views/user/register/index.vue'),
|
|
|
meta: {
|
|
|
ignoreAuth: true,
|
|
|
},
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/forget',
|
|
|
- component: Page,
|
|
|
- children: [
|
|
|
+ },
|
|
|
{
|
|
|
- path: '',
|
|
|
- name: 'forget',
|
|
|
+ path: 'forget',
|
|
|
+ name: 'UserForget',
|
|
|
component: () => import('../views/user/forget/index.vue'),
|
|
|
meta: {
|
|
|
ignoreAuth: true,
|
|
|
},
|
|
|
},
|
|
|
+ {
|
|
|
+ path: 'logoff',
|
|
|
+ name: 'UserLogoff',
|
|
|
+ component: () => import('../views/user/logoff/index.vue'),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: 'password',
|
|
|
+ name: 'UserPassword',
|
|
|
+ component: () => import('../views/user/password/index.vue'),
|
|
|
+ },
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
@@ -358,18 +345,18 @@ const routes: Array<RouteRecordRaw> = [
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- path: '/setting',
|
|
|
+ path: '/navigation',
|
|
|
component: Page,
|
|
|
children: [
|
|
|
{
|
|
|
- path: '',
|
|
|
- name: 'setting',
|
|
|
- component: () => import('../views/setting/main/index.vue'),
|
|
|
+ path: 'setting',
|
|
|
+ name: 'NavigationSetting',
|
|
|
+ component: () => import('../views/navigation/setting/index.vue'),
|
|
|
},
|
|
|
{
|
|
|
- path: 'password',
|
|
|
- name: 'setting-password',
|
|
|
- component: () => import('../views/setting/password/index.vue'),
|
|
|
+ path: 'invoice',
|
|
|
+ name: 'NavigationInvoice',
|
|
|
+ component: () => import('../views/navigation/invoice/index.vue'),
|
|
|
},
|
|
|
]
|
|
|
}
|
|
|
@@ -388,16 +375,16 @@ router.beforeEach((to, from, next) => {
|
|
|
next();
|
|
|
} else {
|
|
|
next({
|
|
|
- name: 'login',
|
|
|
+ name: 'UserLogin',
|
|
|
query: { redirect: to.fullPath },
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
- if (to.name === 'boot' || to.name === 'login') {
|
|
|
+ if (to.name === 'Boot' || to.name === 'UserLogin') {
|
|
|
next();
|
|
|
} else {
|
|
|
next({
|
|
|
- name: 'boot',
|
|
|
+ name: 'Boot',
|
|
|
query: { redirect: to.fullPath },
|
|
|
});
|
|
|
}
|