后端: Go(Gin+GORM+MySQL+Redis) - 17张业务表(yz_pw_前缀), 自动迁移 - JWT认证(3小时) + 盐+MD5密码 + 图形验证码 - 班级CRUD/加入(8人姓名验证/邀请码)/审核/30天自动清理 - 系统配置(16项)/菜单管理(动态路由)/数据统计 - 文件MD5去重/数据隔离/账号封禁/敏感词DFA检测 前端: Vue3+Vite+Element Plus+Less+ECharts+FontAwesome - 动态路由(数据库菜单驱动) - 蓝白配色, H5响应式 - 登录/注册/忘记密码/个人中心 - 班级创建向导/详情/加入/列表 - 管理后台: 审核/配置/菜单/统计/用户/敏感词 数据库: MySQL 10.31.100.3:3306/photowall 管理员: hero920103 / 920103
29 lines
1.7 KiB
Go
29 lines
1.7 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// Menu 菜单/路由表(动态路由数据源)
|
|
type Menu struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
ParentID uint `gorm:"default:0;index" json:"parent_id"`
|
|
Name string `gorm:"size:64;uniqueIndex;not null" json:"name"` // 路由名称(唯一)
|
|
Path string `gorm:"size:255;not null" json:"path"` // 路由路径,如 /class/list
|
|
Component string `gorm:"size:255" json:"component"` // 组件相对路径,如 class/list/index(空则为目录)
|
|
Title string `gorm:"size:64;not null" json:"title"` // 菜单标题
|
|
Icon string `gorm:"size:64" json:"icon"` // fontawesome 图标类名,如 fas fa-home
|
|
Sort int `gorm:"default:0" json:"sort"` // 排序(从小到大)
|
|
Visible bool `gorm:"default:true" json:"visible"` // 是否在菜单中显示
|
|
RequireAuth bool `gorm:"default:true" json:"require_auth"` // 是否需要登录
|
|
RequireAdmin bool `gorm:"default:false" json:"require_admin"` // 是否需要管理员权限
|
|
KeepAlive bool `gorm:"default:false" json:"keep_alive"` // 是否缓存页面
|
|
Redirect string `gorm:"size:255" json:"redirect"` // 重定向路径(目录菜单用)
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// MenuTree 菜单树结构(前端用)
|
|
type MenuTree struct {
|
|
Menu
|
|
Children []*MenuTree `json:"children"`
|
|
}
|