refine imports and styles
This commit is contained in:
1 parent
f538780b91
commit
c9010effbb
47 files changed
+303
-337
No files matched your search
+3
-13
@@ -1,27 +1,17 @@
|
||||
import { t } from '../i18n';
|
||||
import { ROUTE_AUTH_CALLBACK, ROUTE_AUTH_LOGIN } from './constants';
|
||||
|
||||
export default {
|
||||
path: '/auth',
|
||||
name: 'auth',
|
||||
meta: {
|
||||
title: t('common.nav.content')
|
||||
},
|
||||
component: () => import('@/layouts/Auth.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'login',
|
||||
name: 'auth-login',
|
||||
meta: {
|
||||
title: t('common.nav.article')
|
||||
},
|
||||
name: ROUTE_AUTH_LOGIN,
|
||||
component: () => import('@/pages/auth/Login.vue')
|
||||
},
|
||||
{
|
||||
path: 'callback',
|
||||
name: 'auth-callback',
|
||||
meta: {
|
||||
title: t('common.nav.article')
|
||||
},
|
||||
name: ROUTE_AUTH_CALLBACK,
|
||||
component: () => import('@/pages/auth/Callback.vue')
|
||||
}
|
||||
]
|
||||
|
||||
+17
-4
@@ -1,24 +1,37 @@
|
||||
import {
|
||||
ROUTE_CONSOLE_APPLICATION_LIST,
|
||||
ROUTE_CONSOLE_ORDER_DETAIL,
|
||||
ROUTE_CONSOLE_ORDER_LIST,
|
||||
ROUTE_CONSOLE_ROOT
|
||||
} from './constants';
|
||||
|
||||
export default {
|
||||
path: '/console',
|
||||
name: 'console',
|
||||
meta: {
|
||||
auth: true
|
||||
},
|
||||
component: () => import('@/layouts/Console.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: ROUTE_CONSOLE_ROOT,
|
||||
redirect: {
|
||||
name: ROUTE_CONSOLE_APPLICATION_LIST
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
name: 'console-order-list',
|
||||
name: ROUTE_CONSOLE_ORDER_LIST,
|
||||
component: () => import('@/pages/console/order/List.vue')
|
||||
},
|
||||
{
|
||||
path: 'orders/:id',
|
||||
name: 'console-order-detail',
|
||||
name: ROUTE_CONSOLE_ORDER_DETAIL,
|
||||
component: () => import('@/pages/console/order/Detail.vue')
|
||||
},
|
||||
{
|
||||
path: 'applications',
|
||||
name: 'console-application-list',
|
||||
name: ROUTE_CONSOLE_APPLICATION_LIST,
|
||||
component: () => import('@/pages/console/application/List.vue')
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
export const ROUTE_INDEX = 'ROUTE_INDEX';
|
||||
|
||||
export const ROUTE_AUTH_LOGIN = 'auth-login';
|
||||
export const ROUTE_AUTH_CALLBACK = 'auth-callback';
|
||||
|
||||
export const ROUTE_CONSOLE_ROOT = 'console-root';
|
||||
export const ROUTE_CONSOLE_ORDER_LIST = 'console-order-list';
|
||||
export const ROUTE_CONSOLE_ORDER_DETAIL = 'console-order-detail';
|
||||
export const ROUTE_CONSOLE_APPLICATION_LIST = 'console-application-list';
|
||||
|
||||
export const ROUTE_DOCUMENT_LIST = 'document-list';
|
||||
export const ROUTE_DOCUMENT_DETAIL = 'document-detail';
|
||||
|
||||
export const ROUTE_SERVICE_LIST = 'service-list';
|
||||
export const ROUTE_SERVICE_DETAIL = 'service-detail';
|
||||
@@ -1,19 +1,17 @@
|
||||
import { ROUTE_DOCUMENT_DETAIL, ROUTE_DOCUMENT_LIST } from './constants';
|
||||
|
||||
export default {
|
||||
path: '/documents',
|
||||
name: 'documents',
|
||||
meta: {
|
||||
auth: true
|
||||
},
|
||||
component: () => import('@/layouts/Document.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'document-index',
|
||||
component: () => import('@/pages/document/Index.vue')
|
||||
name: ROUTE_DOCUMENT_LIST,
|
||||
component: () => import('@/pages/document/List.vue')
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
name: 'document-detail',
|
||||
name: ROUTE_DOCUMENT_DETAIL,
|
||||
component: () => import('@/pages/document/Detail.vue')
|
||||
}
|
||||
]
|
||||
|
||||
+9
-5
@@ -1,15 +1,18 @@
|
||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import service from './service';
|
||||
import auth from './auth';
|
||||
import console from './console';
|
||||
import document from './document';
|
||||
import store from '@/store';
|
||||
import { ROUTE_AUTH_LOGIN, ROUTE_INDEX, ROUTE_SERVICE_LIST } from './constants';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
redirect: '/services'
|
||||
name: ROUTE_INDEX,
|
||||
redirect: {
|
||||
name: ROUTE_SERVICE_LIST
|
||||
}
|
||||
},
|
||||
service,
|
||||
auth,
|
||||
@@ -19,7 +22,6 @@ const routes = [
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
// history: createWebHashHistory(),
|
||||
routes
|
||||
});
|
||||
|
||||
@@ -27,7 +29,7 @@ router.beforeEach((to, from, next) => {
|
||||
if (to.matched.some((record) => record.meta.auth)) {
|
||||
if (!store.getters.authenticated) {
|
||||
next({
|
||||
name: 'auth-login',
|
||||
name: ROUTE_AUTH_LOGIN,
|
||||
query: { redirect: to.fullPath }
|
||||
});
|
||||
} else {
|
||||
@@ -39,3 +41,5 @@ router.beforeEach((to, from, next) => {
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
export * from './constants';
|
||||
@@ -1,19 +1,17 @@
|
||||
import { ROUTE_SERVICE_DETAIL, ROUTE_SERVICE_LIST, ROUTE_SERVICE_ROOT } from './constants';
|
||||
|
||||
export default {
|
||||
path: '/services',
|
||||
name: 'services',
|
||||
meta: {
|
||||
auth: true
|
||||
},
|
||||
component: () => import('@/layouts/Service.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'service-list',
|
||||
name: ROUTE_SERVICE_LIST,
|
||||
component: () => import('@/pages/service/List.vue')
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
name: 'service-detail',
|
||||
name: ROUTE_SERVICE_DETAIL,
|
||||
component: () => import('@/pages/service/Detail.vue')
|
||||
}
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user