作者 yangfu

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

... ... @@ -139,9 +139,9 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe
transactionContext.RollbackTransaction()
}()
if err = UserAuthService.ChangeUserPhone(header.UserId, request.Phone, request.OldPhone); err != nil {
err = protocol.NewCustomMessage(1, err.Error())
return
}
//TODO:修改完手机号 ,token失效,清理缓存
err = transactionContext.CommitTransaction()
return
}
... ... @@ -160,6 +160,7 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo
transactionContext.RollbackTransaction()
}()
if err = UserAuthService.ResetUserPassword(header.UserId, fmt.Sprintf("%v", header.SimNum), request.NewPwd); err != nil {
err = protocol.NewCustomMessage(1, err.Error())
return
}
err = transactionContext.CommitTransaction()
... ... @@ -302,15 +303,3 @@ func CreateUserAuthService(adminType int, transactionContext *transaction.Transa
//}
//return domain_service.NewPgPartnerAuthService(transactionContext)
}
//TODO:修改密码/重置密码 清除uer_auth 缓存
//清除auth token
//auth := userAuth.NewRedisUserAuth(userAuth.WithUserId(header.UserId))
//if !auth.Exist() {
// return
//}
//if err = auth.RemoveAuth(); err != nil {
// log.Error(err)
// err = protocol.NewErrWithMessage(4140, err)
// return
//}
... ...