feat: RBAC 基本完成
This commit is contained in:
@@ -6,21 +6,23 @@ import (
|
||||
|
||||
type Login interface {
|
||||
GetAccount() string
|
||||
GetUserId() uint
|
||||
GetUserId() string
|
||||
GetUserInfo() any
|
||||
}
|
||||
type User struct {
|
||||
global.BaseModel
|
||||
TenantId string `gorm:"size:20;" json:"tenantId" form:"tenantId"`
|
||||
ClientId string `gorm:"size:20;" json:"clientId"`
|
||||
Account string `gorm:"size:11;unique;" json:"account" form:"account"`
|
||||
Password string `gorm:"size:100;" json:"-" form:"password"`
|
||||
Phone string `gorm:"size:11;" json:"phone" form:"phone"`
|
||||
Roles []Role `gorm:"many2many:user_role;" json:"roles"`
|
||||
}
|
||||
|
||||
func (u *User) GetAccount() string {
|
||||
return u.Account
|
||||
}
|
||||
func (u *User) GetUserId() uint {
|
||||
func (u *User) GetUserId() string {
|
||||
return u.Id
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user