[用户节点]可以管理用户节点

This commit is contained in:
刘祥超
2020-12-14 21:25:11 +08:00
parent cb993259a7
commit 674de0d0b5
16 changed files with 749 additions and 7 deletions

View File

@@ -179,3 +179,17 @@ func (this *UserDAO) ListEnabledUserIds(offset, size int64) ([]int64, error) {
}
return result, nil
}
// 检查用户名、密码
func (this *UserDAO) CheckUserPassword(username string, encryptedPassword string) (int64, error) {
if len(username) == 0 || len(encryptedPassword) == 0 {
return 0, nil
}
return this.Query().
Attr("username", username).
Attr("password", encryptedPassword).
Attr("state", UserStateEnabled).
Attr("isOn", true).
ResultPk().
FindInt64Col(0)
}