实现权限管理页面与功能
This commit is contained in:
28
src/models/admin.ts
Normal file
28
src/models/admin.ts
Normal 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
12
src/models/permission.ts
Normal 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
14
src/models/role.ts
Normal 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[]
|
||||
}
|
||||
Reference in New Issue
Block a user