作者 yangfu

修改: 修改密码错误提示优化

@@ -139,9 +139,9 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe @@ -139,9 +139,9 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe
139 transactionContext.RollbackTransaction() 139 transactionContext.RollbackTransaction()
140 }() 140 }()
141 if err = UserAuthService.ChangeUserPhone(header.UserId, request.Phone, request.OldPhone); err != nil { 141 if err = UserAuthService.ChangeUserPhone(header.UserId, request.Phone, request.OldPhone); err != nil {
  142 + err = protocol.NewCustomMessage(1, err.Error())
142 return 143 return
143 } 144 }
144 - //TODO:修改完手机号 ,token失效,清理缓存  
145 err = transactionContext.CommitTransaction() 145 err = transactionContext.CommitTransaction()
146 return 146 return
147 } 147 }
@@ -160,6 +160,7 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo @@ -160,6 +160,7 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo
160 transactionContext.RollbackTransaction() 160 transactionContext.RollbackTransaction()
161 }() 161 }()
162 if err = UserAuthService.ResetUserPassword(header.UserId, fmt.Sprintf("%v", header.SimNum), request.NewPwd); err != nil { 162 if err = UserAuthService.ResetUserPassword(header.UserId, fmt.Sprintf("%v", header.SimNum), request.NewPwd); err != nil {
  163 + err = protocol.NewCustomMessage(1, err.Error())
163 return 164 return
164 } 165 }
165 err = transactionContext.CommitTransaction() 166 err = transactionContext.CommitTransaction()
@@ -302,15 +303,3 @@ func CreateUserAuthService(adminType int, transactionContext *transaction.Transa @@ -302,15 +303,3 @@ func CreateUserAuthService(adminType int, transactionContext *transaction.Transa
302 //} 303 //}
303 //return domain_service.NewPgPartnerAuthService(transactionContext) 304 //return domain_service.NewPgPartnerAuthService(transactionContext)
304 } 305 }
305 -  
306 -//TODO:修改密码/重置密码 清除uer_auth 缓存  
307 -//清除auth token  
308 -//auth := userAuth.NewRedisUserAuth(userAuth.WithUserId(header.UserId))  
309 -//if !auth.Exist() {  
310 -// return  
311 -//}  
312 -//if err = auth.RemoveAuth(); err != nil {  
313 -// log.Error(err)  
314 -// err = protocol.NewErrWithMessage(4140, err)  
315 -// return  
316 -//}