feat:完善信息
This commit is contained in:
20
app/api/enterprise/model/user_instance.go
Normal file
20
app/api/enterprise/model/user_instance.go
Normal file
@ -0,0 +1,20 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"SciencesServer/app/common/model"
|
||||
"SciencesServer/utils"
|
||||
)
|
||||
|
||||
type UserInstance struct{ *model.UserInstance }
|
||||
|
||||
func (m *UserInstance) UUIDToString() string {
|
||||
return utils.UintToString(m.UUID)
|
||||
}
|
||||
|
||||
func (m *UserInstance) ValidatePassword(password string) bool {
|
||||
return utils.HashCompare([]byte(m.Password), []byte(utils.Md5String(password, m.Salt)))
|
||||
}
|
||||
|
||||
func NewUserInstance() *UserInstance {
|
||||
return &UserInstance{UserInstance: model.NewUserInstance()}
|
||||
}
|
Reference in New Issue
Block a user