fix: add role limit
This commit is contained in:
@@ -3,7 +3,7 @@ package models
|
||||
import "time"
|
||||
|
||||
type BackUser struct {
|
||||
ID int `gorm:"primaryKey;column:id" json:"-"` // 用户ID
|
||||
ID int `gorm:"primaryKey;column:id" json:"id"` // 用户ID
|
||||
Username string `gorm:"column:username" json:"username"` // 用户真实姓名
|
||||
Password string `gorm:"column:password" json:"password"` // 用户密码
|
||||
Role int `gorm:"column:role" json:"role"` // 用户角色
|
||||
@@ -14,6 +14,7 @@ type BackUser struct {
|
||||
Approver int `gorm:"column:approver" json:"approver"` // 注册审核人ID
|
||||
ModifyTime time.Time `gorm:"column:modify_time" json:"modifyTime"`
|
||||
IsDelete int8 `gorm:"column:is_delete" json:"isDelete"` // 删除标志
|
||||
Region string `gorm:"column:region" json:"region"` // 用户所属地域
|
||||
}
|
||||
|
||||
type UserLogin struct {
|
||||
@@ -27,6 +28,8 @@ type UserRegister struct {
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
Aptitude string `json:"aptitude"`
|
||||
Region string `json:"region"`
|
||||
Role int `json:"role"`
|
||||
}
|
||||
|
||||
type UserChangePwd struct {
|
||||
@@ -40,6 +43,14 @@ type UserApprove struct {
|
||||
Pass bool `json:"pass"`
|
||||
}
|
||||
|
||||
type TokenClaims struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Email string `json:"email"`
|
||||
Role int `json:"role"`
|
||||
Region string `json:"region"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
initJcMap[BackUser]()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user