From c7bb6ebb7f8edadfd0e423ce407d2672055e2d5b Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Wed, 19 Mar 2025 18:48:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=9C=AA=E7=9F=A5=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=94=B9=E4=B8=BA=E6=8A=A5=E5=86=85=E9=83=A8=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/i18n/messages_en_US.properties | 1 + .../src/main/resources/i18n/messages_zh_CN.properties | 1 + .../wfc/common/security/handler/GlobalExceptionHandler.java | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wfc-common/wfc-common-core/src/main/resources/i18n/messages_en_US.properties b/wfc-common/wfc-common-core/src/main/resources/i18n/messages_en_US.properties index 96b7f5b..eafd71c 100644 --- a/wfc-common/wfc-common-core/src/main/resources/i18n/messages_en_US.properties +++ b/wfc-common/wfc-common-core/src/main/resources/i18n/messages_en_US.properties @@ -177,6 +177,7 @@ common.no.permission=No permission, please contact the administrator to add perm common.request.path.variable.not.blank=Request path variable''{0}'' cannot be blank common.request.parameter.type.not.match=Request parameter''{0}'' requires type: ''{1}'', but the input value is: ''{2}'' common.demo.mode=Demo mode, no operation is allowed +common.system.error=Internal error, please contact the administrator ## system portal menu menu.system.management=System Management diff --git a/wfc-common/wfc-common-core/src/main/resources/i18n/messages_zh_CN.properties b/wfc-common/wfc-common-core/src/main/resources/i18n/messages_zh_CN.properties index 91a83a3..181159f 100644 --- a/wfc-common/wfc-common-core/src/main/resources/i18n/messages_zh_CN.properties +++ b/wfc-common/wfc-common-core/src/main/resources/i18n/messages_zh_CN.properties @@ -179,6 +179,7 @@ common.no.permission=没有访问权限,请联系管理员授权 common.request.path.variable.not.blank=请求路径中缺少必需的路径变量''{0}'' common.request.parameter.type.not.match=请求参数类型不匹配,参数''{0}''要求类型为:''{1}'',但输入值为:''{2}'' common.demo.mode=演示模式,不允许操作 +common.system.error=内部错误,请联系管理员 ## system portal menu menu.system.management=系统管理 diff --git a/wfc-common/wfc-common-security/src/main/java/org/wfc/common/security/handler/GlobalExceptionHandler.java b/wfc-common/wfc-common-security/src/main/java/org/wfc/common/security/handler/GlobalExceptionHandler.java index 0db1fe0..9eb85e1 100644 --- a/wfc-common/wfc-common-security/src/main/java/org/wfc/common/security/handler/GlobalExceptionHandler.java +++ b/wfc-common/wfc-common-security/src/main/java/org/wfc/common/security/handler/GlobalExceptionHandler.java @@ -1,6 +1,5 @@ package org.wfc.common.security.handler; -import javax.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.validation.BindException; @@ -22,6 +21,8 @@ import org.wfc.common.core.utils.StringUtils; import org.wfc.common.core.utils.html.EscapeUtil; import org.wfc.common.core.web.domain.AjaxResult; +import javax.servlet.http.HttpServletRequest; + /** * 全局异常处理器 * @@ -111,7 +112,7 @@ public class GlobalExceptionHandler { String requestURI = request.getRequestURI(); log.error("Requesting address '{}', an unknown exception occurred.", requestURI, e); - return AjaxResult.error(e.getMessage()); + return AjaxResult.error(MessageUtils.message("common.system.error")); } /** From 54fe64c7ead044bc9ab8e446a9446ac361878b10 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Wed, 19 Mar 2025 18:49:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/wfc/auth/controller/TokenController.java | 3 +-- .../main/java/org/wfc/auth/service/ULoginService.java | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/wfc-auth/src/main/java/org/wfc/auth/controller/TokenController.java b/wfc-auth/src/main/java/org/wfc/auth/controller/TokenController.java index b27d4e2..fe14434 100644 --- a/wfc-auth/src/main/java/org/wfc/auth/controller/TokenController.java +++ b/wfc-auth/src/main/java/org/wfc/auth/controller/TokenController.java @@ -117,8 +117,7 @@ public class TokenController { @PostMapping("checkRepeat") public R checkRepeat(@RequestBody RegisterBody form) { if ("u".equals(form.getAuthType())) { - uLoginService.checkRepeat(form); - return R.ok(); + return R.ok(uLoginService.checkRepeat(form)); } if ("sys".equals(form.getAuthType())) { } diff --git a/wfc-auth/src/main/java/org/wfc/auth/service/ULoginService.java b/wfc-auth/src/main/java/org/wfc/auth/service/ULoginService.java index 7899642..a3d0d89 100644 --- a/wfc-auth/src/main/java/org/wfc/auth/service/ULoginService.java +++ b/wfc-auth/src/main/java/org/wfc/auth/service/ULoginService.java @@ -160,19 +160,17 @@ public class ULoginService { /** * 检查重复 */ - public void checkRepeat(RegisterBody registerBody) { + public boolean checkRepeat(RegisterBody registerBody) { UUser user = new UUser(); user.setUserName(registerBody.getUsername()); user.setPhonenumber(registerBody.getPhonenumber()); user.setEmail(registerBody.getEmail()); R result = remoteUserService.checkRepeat(user, SecurityConstants.INNER ); + if (R.FAIL == result.getCode()) { - throw new ServiceException(result.getMsg()); - } - Boolean isRepeat = result.getData(); - if (isRepeat) { - throw new ServiceException("auth.user.registered"); + return true; } + return result.getData(); } } From 563e97d377e3438dee4f8e11c889736f82ef276f Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Fri, 21 Mar 2025 10:42:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wfc-gen/src/main/resources/templates/controller.java.vm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wfc-modules/wfc-gen/src/main/resources/templates/controller.java.vm b/wfc-modules/wfc-gen/src/main/resources/templates/controller.java.vm index 9459beb..690b1d4 100644 --- a/wfc-modules/wfc-gen/src/main/resources/templates/controller.java.vm +++ b/wfc-modules/wfc-gen/src/main/resources/templates/controller.java.vm @@ -53,13 +53,13 @@ public class ${table.controllerName} extends BaseController { @GetMapping("/page") public TableDataInfo page(${entity} $entityName) { startPage(); - List<${entity}> list = ${serviceName}.list(); + List<${entity}> list = ${serviceName}.queryList($entityName); return getDataTable(list); } @GetMapping("/list") public AjaxResult list(${entity} $entityName) { - List<${entity}> list = ${serviceName}.list(); + List<${entity}> list = ${serviceName}.queryList($entityName); return success(list); }