优化系统用户登录校验

This commit is contained in:
刘祥超
2020-12-07 11:46:02 +08:00
parent ecf3aaeaee
commit 415539df93
3 changed files with 31 additions and 3 deletions

View File

@@ -63,6 +63,19 @@ func (this *UserDAO) FindEnabledUser(id int64) (*User, error) {
return result.(*User), err
}
// 查找用户基本信息
func (this *UserDAO) FindEnabledBasicUser(id int64) (*User, error) {
result, err := this.Query().
Pk(id).
Attr("state", UserStateEnabled).
Result("id", "fullname", "username").
Find()
if result == nil {
return nil, err
}
return result.(*User), err
}
// 获取管理员名称
func (this *UserDAO) FindUserFullname(userId int64) (string, error) {
return this.Query().