From 7d5831b5f4c3b2b8f8c7d1fc06f32b9e621f3025 Mon Sep 17 00:00:00 2001 From: yukaidi Date: Fri, 29 May 2026 05:53:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BD=BB=E5=BA=95=E6=B6=88=E9=99=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9E=9A=E4=B8=BE=E5=92=8C=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=B3=84=E9=9C=B2=E7=9A=84=E9=81=97=E7=95=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - UserServiceImpl: 3处"用户不存在"统一改为"用户名或密码错误"/"认证失败" - RouterHandlerFactory: failureHandler 中 ctx.failure().getMessage() 改为"服务器内部错误" --- .../vx/core/handlerfactory/RouterHandlerFactory.java | 2 +- .../cn/qaiu/lz/web/service/impl/UserServiceImpl.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/cn/qaiu/vx/core/handlerfactory/RouterHandlerFactory.java b/core/src/main/java/cn/qaiu/vx/core/handlerfactory/RouterHandlerFactory.java index f573f6a..6f704a3 100644 --- a/core/src/main/java/cn/qaiu/vx/core/handlerfactory/RouterHandlerFactory.java +++ b/core/src/main/java/cn/qaiu/vx/core/handlerfactory/RouterHandlerFactory.java @@ -181,7 +181,7 @@ public class RouterHandlerFactory implements BaseHttpApi { doFireJsonResultResponse(ctx, JsonResult.error("未知异常, 请联系管理员"), 503); } else { LOGGER.error("路由处理失败", ctx.failure()); - doFireJsonResultResponse(ctx, JsonResult.error(ctx.failure().getMessage()), 500); + doFireJsonResultResponse(ctx, JsonResult.error("服务器内部错误"), 500); } }); } else if (method.isAnnotationPresent(SockRouteMapper.class)) { diff --git a/web-service/src/main/java/cn/qaiu/lz/web/service/impl/UserServiceImpl.java b/web-service/src/main/java/cn/qaiu/lz/web/service/impl/UserServiceImpl.java index ac567ef..c428111 100644 --- a/web-service/src/main/java/cn/qaiu/lz/web/service/impl/UserServiceImpl.java +++ b/web-service/src/main/java/cn/qaiu/lz/web/service/impl/UserServiceImpl.java @@ -189,10 +189,10 @@ public class UserServiceImpl implements UserService { .execute(Tuple.of(username)) .onSuccess(rows -> { if (rows.size() == 0) { - promise.fail("用户不存在"); + promise.fail("用户名或密码错误"); return; } - + Row row = rows.iterator().next(); SysUser user = rowToUser(row); promise.complete(filterSensitiveInfo(user)); @@ -296,10 +296,10 @@ public class UserServiceImpl implements UserService { .execute(Tuple.of(user.getUsername())) .onSuccess(rows -> { if (rows.size() == 0) { - promise.fail("用户不存在"); + promise.fail("用户名或密码错误"); return; } - + Row row = rows.iterator().next(); SysUser existUser = rowToUser(row); @@ -406,7 +406,7 @@ public class UserServiceImpl implements UserService { .onFailure(err -> { promise.complete(new JsonObject() .put("success", false) - .put("message", "用户不存在")); + .put("message", "认证失败,请重新登录")); }); return promise.future();