...
|
...
|
@@ -27,15 +27,15 @@ func (s *PgPartnerAuthService) ChangeUserPhone(userId int64, newPhone, oldPhone |
|
|
PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext)
|
|
|
partnerInfo *domain.PartnerInfo
|
|
|
)
|
|
|
if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": oldPhone}); err != nil || (partnerInfo.Account != oldPhone) {
|
|
|
err = errUserNotFound //账号不存在
|
|
|
return
|
|
|
}
|
|
|
//验证新手机是否已经存在
|
|
|
if _, e := PartnerInfoService.FindOne(map[string]interface{}{"account": newPhone}); e == nil {
|
|
|
err = fmt.Errorf("当前手机号已存在,请重新输入") //账号已存在
|
|
|
return
|
|
|
}
|
|
|
if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": oldPhone}); err != nil || (partnerInfo.Account != oldPhone) {
|
|
|
err = errUserNotFound //账号不存在
|
|
|
return
|
|
|
}
|
|
|
if err = PartnerInfoDao.Update(map[string]interface{}{
|
|
|
"oldAccount": oldPhone,
|
|
|
"Account": newPhone,
|
...
|
...
|
@@ -51,7 +51,7 @@ func (s *PgPartnerAuthService) ChangeUserPassword(userId int64, newPwd, oldPwd, |
|
|
PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext)
|
|
|
)
|
|
|
if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": phone}); err != nil {
|
|
|
err = fmt.Errorf("账号不存在") //账号不存在
|
|
|
err = errUserNotFound //账号不存在
|
|
|
return
|
|
|
}
|
|
|
if !strings.EqualFold(partnerInfo.Password, oldPwd) {
|
...
|
...
|
@@ -73,7 +73,7 @@ func (s *PgPartnerAuthService) ResetUserPassword(userId int64, phone, password s |
|
|
PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext)
|
|
|
)
|
|
|
if _, err = PartnerInfoService.FindOne(map[string]interface{}{"account": phone}); err != nil {
|
|
|
err = fmt.Errorf("账号不存在") //账号不存在
|
|
|
err = errUserNotFound //账号不存在
|
|
|
return
|
|
|
}
|
|
|
if err = PartnerInfoDao.Update(map[string]interface{}{
|
...
|
...
|
|