feat: passwork login

This commit is contained in:
zzw
2026-09-03 10:33:48 +08:00
parent 533842e140
commit 493416551b
5 changed files with 77 additions and 1 deletions
@@ -68,6 +68,21 @@ func findCredential(credentialType, identifier string) (*dao.UserCredential, err
return &cred, nil
}
func userHasEnabledClient(userId int64, clientCode string) (bool, error) {
var row dao.UserClient
clientModel := model.UserClientModel{}.Init()
if err := clientModel.GetOne(modelbase.Params{
Eq: map[string]string{
"user_id": strconv.FormatInt(userId, utils.NumberTen),
"client_code": clientCode,
"status": strconv.Itoa(int(dao.StatusEnabled)),
},
}, &row); err != nil {
return false, err
}
return row.Id >= utils.NumberOne, nil
}
func loadEnabledUser(userId int64) (*dao.UserRow, error) {
var row dao.UserRow
userModel := model.UserModel{}.Init()