feat: passwork login
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user