2025-06-16 14:42:26 +08:00
|
|
|
/*
|
|
|
|
|
* @Author: 田鑫
|
|
|
|
|
* @Date: 2023-03-05 18:14:17
|
2025-06-20 06:10:15 -04:00
|
|
|
* @LastEditors: Please set LastEditors
|
2025-06-22 22:52:03 -04:00
|
|
|
* @LastEditTime: 2025-06-22 22:46:01
|
2025-06-16 14:42:26 +08:00
|
|
|
* @Description:
|
|
|
|
|
*/
|
|
|
|
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
|
|
|
import { appRoutes } from './routes';
|
|
|
|
|
import { REDIRECT_MAIN, NOT_FOUND_ROUTE } from './routes/base';
|
|
|
|
|
import NProgress from 'nprogress';
|
|
|
|
|
import 'nprogress/nprogress.css';
|
|
|
|
|
|
|
|
|
|
import createRouteGuard from './guard';
|
|
|
|
|
|
|
|
|
|
NProgress.configure({ showSpinner: false }); // NProgress Configuration
|
|
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
|
|
|
routes: [
|
|
|
|
|
{
|
2025-06-17 11:18:39 +08:00
|
|
|
path: '/login',
|
2025-06-22 22:52:03 -04:00
|
|
|
name: 'login',
|
2025-06-17 11:18:39 +08:00
|
|
|
component: () => import('@/views/components/login'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/workplace',
|
2025-06-16 14:42:26 +08:00
|
|
|
name: 'workplace',
|
|
|
|
|
component: () => import('@/views/components/workplace'),
|
2025-06-22 22:52:03 -04:00
|
|
|
meta: {
|
|
|
|
|
hideSidebar: true,
|
|
|
|
|
},
|
2025-06-16 14:42:26 +08:00
|
|
|
},
|
2025-06-17 11:18:39 +08:00
|
|
|
{
|
|
|
|
|
path: '/',
|
2025-06-22 22:52:03 -04:00
|
|
|
name: 'dataEngine',
|
2025-06-17 11:18:39 +08:00
|
|
|
redirect: '/dataEngine/dataEngine/hotTranslation',
|
|
|
|
|
children: [...appRoutes, REDIRECT_MAIN, NOT_FOUND_ROUTE],
|
|
|
|
|
},
|
2025-06-16 14:42:26 +08:00
|
|
|
{
|
|
|
|
|
path: '/dataEngine',
|
|
|
|
|
name: 'dataEngine',
|
2025-06-17 11:18:39 +08:00
|
|
|
redirect: '/dataEngine/dataEngine/hotTranslation',
|
2025-06-16 14:42:26 +08:00
|
|
|
children: [...appRoutes, REDIRECT_MAIN, NOT_FOUND_ROUTE],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/permission',
|
|
|
|
|
name: 'permission',
|
|
|
|
|
component: () => import('@/views/components/permission/choose-enterprise.vue'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/auth',
|
|
|
|
|
name: 'auth',
|
|
|
|
|
component: () => import('@/views/components/permission/auth.vue'),
|
|
|
|
|
},
|
2025-06-18 18:00:33 +08:00
|
|
|
{
|
|
|
|
|
path: '/management/person',
|
|
|
|
|
name: 'person',
|
|
|
|
|
component: () => import('@/views/components/management/person'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/management/enterprise',
|
|
|
|
|
name: 'enterprise',
|
|
|
|
|
component: () => import('@/views/components/management/enterprise'),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/management/account',
|
|
|
|
|
name: 'account',
|
|
|
|
|
component: () => import('@/views/components/management/account'),
|
|
|
|
|
},
|
2025-06-16 14:42:26 +08:00
|
|
|
],
|
|
|
|
|
scrollBehavior() {
|
|
|
|
|
return { top: 0 };
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
createRouteGuard(router);
|
|
|
|
|
|
|
|
|
|
export default router;
|