fix: 修复多个安全缺陷和功能问题

- 移除加密相关代码(服务端和所有客户端)
- 修复 JWT 验证未检查签名算法的问题
- 修复重置密码使用不安全随机数的问题
- 实现 Logout 服务端失效机制
- 修复历史版本对比 diff 颜色标记错误
- 修复占位符解析循环引用风险
- 添加用户禁用状态检查
- 更新 bug 清单文档
This commit is contained in:
2026-03-10 21:07:22 +08:00
parent f41d53da41
commit 932db9fbdc
27 changed files with 292 additions and 721 deletions
+13 -12
View File
@@ -3,18 +3,19 @@ package model
import "time"
type User struct {
Id int `xorm:"int autoincr pk" json:"id"`
GroupId *int `xorm:"int" json:"groupId"`
Name string `xorm:"varchar(16)" json:"name"`
Password string `xorm:"varchar(64)" json:"-"`
Mobile string `xorm:"char(11)" json:"mobile"`
Email string `xorm:"varchar(32)" json:"email"`
Type string `xorm:"varchar(16) default 'user'" json:"type"` // user, groupAdmin, superAdmin
Enabled bool `xorm:"tinyint(1) default 1" json:"enabled"`
CreatedAt *time.Time `xorm:"datetime" json:"createdAt"`
UpdatedAt *time.Time `xorm:"datetime" json:"updatedAt"`
GroupName string `xorm:"-" json:"groupName,omitempty"`
GroupMaster bool `xorm:"-" json:"groupMaster,omitempty"`
Id int `xorm:"int autoincr pk" json:"id"`
GroupId *int `xorm:"int" json:"groupId"`
Name string `xorm:"varchar(16)" json:"name"`
Password string `xorm:"varchar(64)" json:"-"`
Mobile string `xorm:"char(11)" json:"mobile"`
Email string `xorm:"varchar(32)" json:"email"`
Type string `xorm:"varchar(16) default 'user'" json:"type"` // user, groupAdmin, superAdmin
Enabled bool `xorm:"tinyint(1) default 1" json:"enabled"`
CreatedAt *time.Time `xorm:"datetime" json:"createdAt"`
UpdatedAt *time.Time `xorm:"datetime" json:"updatedAt"`
LastLogoutAt *time.Time `xorm:"datetime" json:"-"`
GroupName string `xorm:"-" json:"groupName,omitempty"`
GroupMaster bool `xorm:"-" json:"groupMaster,omitempty"`
}
type UserPermission struct {