mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-23 19:33:42 +08:00
init
This commit is contained in:
19
frontend/src/router/modules/auth.ts
Normal file
19
frontend/src/router/modules/auth.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import { RouteName, RoutePath } from "../constants";
|
||||
|
||||
const authRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: RoutePath.HOME,
|
||||
name: RouteName.HOME,
|
||||
redirect: {
|
||||
name: RouteName.LOGIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.LOGIN,
|
||||
name: RouteName.LOGIN,
|
||||
component: () => import("../../views/LoginView.vue"),
|
||||
},
|
||||
];
|
||||
|
||||
export default authRoutes;
|
||||
67
frontend/src/router/modules/dashboard.ts
Normal file
67
frontend/src/router/modules/dashboard.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import Dashboard from "../../components/Dashboard.vue";
|
||||
import OverView from "../../views/OverView.vue";
|
||||
import { ROLE, RouteName, RoutePath } from "../constants";
|
||||
import userManagementRoutes from "./user";
|
||||
|
||||
const dashboardRoutes: RouteRecordRaw = {
|
||||
path: RoutePath.DASHBOARD,
|
||||
name: RouteName.DASHBOARD,
|
||||
component: Dashboard,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: RoutePath.OVERVIEW,
|
||||
name: RouteName.OVERVIEW,
|
||||
component: () => import("@/views/OverView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.SETTINGS,
|
||||
name: RouteName.SETTINGS,
|
||||
component: () => import("@/views/SettingsView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
...userManagementRoutes,
|
||||
{
|
||||
path: RoutePath.NOTFOUND,
|
||||
name: RouteName.NOTFOUND,
|
||||
component: () => import("@/views/NotFound.vue"),
|
||||
},
|
||||
{
|
||||
path: RoutePath.SCHEDULERVIEW,
|
||||
name: RouteName.SCHEDULERVIEW,
|
||||
component: () => import("@/views/SchedulerView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.DEPARTMENTVIEW,
|
||||
name: RouteName.DEPARTMENTVIEW,
|
||||
component: () => import("@/views/DepartmentView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.POSITIONVIEW,
|
||||
name: RouteName.POSITIONVIEW,
|
||||
component: () => import("@/views/PositionView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default dashboardRoutes;
|
||||
12
frontend/src/router/modules/error.ts
Normal file
12
frontend/src/router/modules/error.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import { RouteName, RoutePath } from "../constants";
|
||||
|
||||
const errorRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: RoutePath.GLOBAL_NOTFOUND,
|
||||
name: RouteName.GLOBAL_NOTFOUND,
|
||||
component: () => import("../../views/NotFound.vue"),
|
||||
},
|
||||
];
|
||||
|
||||
export default errorRoutes;
|
||||
70
frontend/src/router/modules/user.ts
Normal file
70
frontend/src/router/modules/user.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import { ROLE, RouteName, RoutePath } from "../constants";
|
||||
|
||||
const userManagementRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: RoutePath.USERVIEW,
|
||||
name: RouteName.USERVIEW,
|
||||
component: () => import("@/views/UserView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.ROLEVIEW,
|
||||
name: RouteName.ROLEVIEW,
|
||||
component: () => import("@/views/RoleView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.BINDROLEVIEW,
|
||||
name: RouteName.BINDROLEVIEW,
|
||||
component: () => import("@/views/BindRoleView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.BINDDEPARTMENTVIEW,
|
||||
name: RouteName.BINDDEPARTMENTVIEW,
|
||||
component: () => import("@/views/BindDepartmentView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.BINDPERMISSIONVIEW,
|
||||
name: RouteName.BINDPERMISSIONVIEW,
|
||||
component: () => import("@/views/BindPermissionView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.PERMISSIONVIEW,
|
||||
name: RouteName.PERMISSIONVIEW,
|
||||
component: () => import("@/views/PermissionView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: RoutePath.BINDPOSITIONVIEW,
|
||||
name: RouteName.BINDPOSITIONVIEW,
|
||||
component: () => import("@/views/BindPositionView.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
hasRole: ROLE.ADMIN,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default userManagementRoutes;
|
||||
Reference in New Issue
Block a user