加固后台管理安全
This commit is contained in:
@@ -3,15 +3,17 @@ package model
|
||||
import "time"
|
||||
|
||||
type AdminUser struct {
|
||||
ID uint64 `gorm:"primaryKey" json:"id"`
|
||||
Username string `gorm:"size:64;not null;uniqueIndex" json:"username"`
|
||||
PasswordHash string `gorm:"size:255;not null" json:"-"`
|
||||
Nickname string `gorm:"size:64;not null;default:''" json:"nickname"`
|
||||
Status string `gorm:"size:32;not null;default:'active'" json:"status"`
|
||||
SupportStatus string `gorm:"size:16;not null;default:'offline';index" json:"support_status"`
|
||||
LastLoginAt *time.Time `json:"last_login_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID uint64 `gorm:"primaryKey" json:"id"`
|
||||
Username string `gorm:"size:64;not null;uniqueIndex" json:"username"`
|
||||
PasswordHash string `gorm:"size:255;not null" json:"-"`
|
||||
Nickname string `gorm:"size:64;not null;default:''" json:"nickname"`
|
||||
Status string `gorm:"size:32;not null;default:'active'" json:"status"`
|
||||
SupportStatus string `gorm:"size:16;not null;default:'offline';index" json:"support_status"`
|
||||
TokenVersion int64 `gorm:"not null;default:1" json:"-"`
|
||||
PasswordMustChange bool `gorm:"not null;default:false" json:"password_must_change"`
|
||||
LastLoginAt *time.Time `json:"last_login_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
func (AdminUser) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user