作者 yangfu

修改: 登录提示修改

@@ -27,15 +27,15 @@ func (s *PgPartnerAuthService) ChangeUserPhone(userId int64, newPhone, oldPhone @@ -27,15 +27,15 @@ func (s *PgPartnerAuthService) ChangeUserPhone(userId int64, newPhone, oldPhone
27 PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext) 27 PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext)
28 partnerInfo *domain.PartnerInfo 28 partnerInfo *domain.PartnerInfo
29 ) 29 )
  30 + if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": oldPhone}); err != nil || (partnerInfo.Account != oldPhone) {
  31 + err = errUserNotFound //账号不存在
  32 + return
  33 + }
30 //验证新手机是否已经存在 34 //验证新手机是否已经存在
31 if _, e := PartnerInfoService.FindOne(map[string]interface{}{"account": newPhone}); e == nil { 35 if _, e := PartnerInfoService.FindOne(map[string]interface{}{"account": newPhone}); e == nil {
32 err = fmt.Errorf("当前手机号已存在,请重新输入") //账号已存在 36 err = fmt.Errorf("当前手机号已存在,请重新输入") //账号已存在
33 return 37 return
34 } 38 }
35 - if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": oldPhone}); err != nil || (partnerInfo.Account != oldPhone) {  
36 - err = errUserNotFound //账号不存在  
37 - return  
38 - }  
39 if err = PartnerInfoDao.Update(map[string]interface{}{ 39 if err = PartnerInfoDao.Update(map[string]interface{}{
40 "oldAccount": oldPhone, 40 "oldAccount": oldPhone,
41 "Account": newPhone, 41 "Account": newPhone,
@@ -51,7 +51,7 @@ func (s *PgPartnerAuthService) ChangeUserPassword(userId int64, newPwd, oldPwd, @@ -51,7 +51,7 @@ func (s *PgPartnerAuthService) ChangeUserPassword(userId int64, newPwd, oldPwd,
51 PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext) 51 PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext)
52 ) 52 )
53 if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": phone}); err != nil { 53 if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": phone}); err != nil {
54 - err = fmt.Errorf("账号不存在") //账号不存在 54 + err = errUserNotFound //账号不存在
55 return 55 return
56 } 56 }
57 if !strings.EqualFold(partnerInfo.Password, oldPwd) { 57 if !strings.EqualFold(partnerInfo.Password, oldPwd) {
@@ -73,7 +73,7 @@ func (s *PgPartnerAuthService) ResetUserPassword(userId int64, phone, password s @@ -73,7 +73,7 @@ func (s *PgPartnerAuthService) ResetUserPassword(userId int64, phone, password s
73 PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext) 73 PartnerInfoService, _ = repository.NewPartnerInfoRepository(s.transactionContext)
74 ) 74 )
75 if _, err = PartnerInfoService.FindOne(map[string]interface{}{"account": phone}); err != nil { 75 if _, err = PartnerInfoService.FindOne(map[string]interface{}{"account": phone}); err != nil {
76 - err = fmt.Errorf("账号不存在") //账号不存在 76 + err = errUserNotFound //账号不存在
77 return 77 return
78 } 78 }
79 if err = PartnerInfoDao.Update(map[string]interface{}{ 79 if err = PartnerInfoDao.Update(map[string]interface{}{