53fa259284
Deploy Server / release-deploy-server (push) Successful in 40s
会话/设备管理后端:user_sessions 会话表、JWT 加 sid 校验、按平台类限并发登录、 登录失败锁定、修复禁用账号仍可凭 refresh 续期漏洞、/auth/ping、/auth/logout、 GET /sessions、DELETE /sessions/:id(管理员强制下线)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
719 B
Go
17 lines
719 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type User struct {
|
|
Base
|
|
ShopID uint64 `gorm:"not null;index;uniqueIndex:uk_shop_username" json:"shop_id"`
|
|
Username string `gorm:"size:50;uniqueIndex:uk_shop_username" json:"username"`
|
|
PasswordHash string `gorm:"size:255" json:"-"`
|
|
RealName string `gorm:"size:50" json:"real_name"`
|
|
Phone string `gorm:"size:30" json:"phone"`
|
|
Role string `gorm:"type:enum('admin','operator','readonly','superadmin');default:'operator'" json:"role"`
|
|
IsActive bool `gorm:"default:true" json:"is_active"`
|
|
LastLoginAt *time.Time `json:"last_login_at,omitempty"`
|
|
CustomFields JSON `gorm:"type:json" json:"custom_fields,omitempty"`
|
|
}
|