实现权限管理页面与功能

This commit is contained in:
2026-03-18 17:13:31 +08:00
parent efe1568ab5
commit c4e1da8912
25 changed files with 2245 additions and 18 deletions

28
src/models/admin.ts Normal file
View File

@@ -0,0 +1,28 @@
import type { Role } from "./role"
// 管理员状态枚举
export enum AdminStatus {
Disabled = 0, // 禁用
Enabled = 1, // 正常
}
// 管理员
export type Admin = {
id: number
createdAt: Date
updatedAt: Date
username: string
password: string
name?: string
avatar?: string
phone?: string
email?: string
status: AdminStatus
lastLogin?: Date
lastLoginIp?: string
lastLoginUa?: string
roles: Role[]
}

12
src/models/permission.ts Normal file
View File

@@ -0,0 +1,12 @@
export type Permission = {
id: number
created_at: Date
updated_at: Date
expired_at: Date
parent_id: number
name: string
description: string
parent: number
children: Permission[]
}

14
src/models/role.ts Normal file
View File

@@ -0,0 +1,14 @@
import type { Permission } from "./permission"
export type Role = {
id: number
created_at: Date
updated_at: Date
name: string
description: string
active: boolean
sort: number
permissions: Permission[]
}