From b84e7013d23e0947bff4a3c4ce15fc6af6a8ad05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=B0=8F=E6=B3=95?= Date: Tue, 14 Sep 2021 15:15:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=A6=81=E7=94=A8el-tag=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=B8=90=E5=8F=98=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/DictTag/index.vue | 103 +++++++++++----------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/ruoyi-ui/src/components/DictTag/index.vue b/ruoyi-ui/src/components/DictTag/index.vue index 542c6edd8..b0484bc15 100644 --- a/ruoyi-ui/src/components/DictTag/index.vue +++ b/ruoyi-ui/src/components/DictTag/index.vue @@ -1,51 +1,52 @@ - - - - \ No newline at end of file + + + + From dbe3446b633bcf374fc529da8a6bf3e0abf67afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=9A=E5=B1=BF?= <1491182878@qq.com> Date: Tue, 14 Sep 2021 13:53:32 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E4=B8=BB=E5=AD=90=E8=A1=A8=E4=BB=A3=E7=A0=81=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=90=8D=E7=94=9F=E6=88=90=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-generator/src/main/resources/vm/java/mapper.java.vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm b/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm index 42d015db7..7e7d7c26f 100644 --- a/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/mapper.java.vm @@ -69,7 +69,7 @@ public interface ${ClassName}Mapper * @param ${pkColumn.javaField}s 需要删除的数据主键集合 * @return 结果 */ - public int delete${subClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); + public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); /** * 批量新增${subTable.functionName} From 23270c60bcb9128c6a6b2fec734472397e992642 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 16 Sep 2021 16:03:49 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=98=AF=E5=90=A6=E4=BF=9D=E5=AD=98=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/annotation/Log.java | 5 +++++ .../java/com/ruoyi/framework/aspectj/LogAspect.java | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java index 3458c882d..4b1f13072 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java @@ -38,4 +38,9 @@ public @interface Log * 是否保存请求的参数 */ public boolean isSaveRequestData() default true; + + /** + * 是否保存响应的参数 + */ + public boolean isSaveResponseData() default true; } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index b7cf17bbe..97c249051 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -92,9 +92,6 @@ public class LogAspect // 请求的地址 String ip = IpUtils.getIpAddr(ServletUtils.getRequest()); operLog.setOperIp(ip); - // 返回参数 - operLog.setJsonResult(JSON.toJSONString(jsonResult)); - operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); if (loginUser != null) { @@ -113,7 +110,7 @@ public class LogAspect // 设置请求方式 operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); // 处理设置注解上的参数 - getControllerMethodDescription(joinPoint, controllerLog, operLog); + getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult); // 保存数据库 AsyncManager.me().execute(AsyncFactory.recordOper(operLog)); } @@ -133,7 +130,7 @@ public class LogAspect * @param operLog 操作日志 * @throws Exception */ - public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog) throws Exception + public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog, Object jsonResult) throws Exception { // 设置action动作 operLog.setBusinessType(log.businessType().ordinal()); @@ -147,6 +144,11 @@ public class LogAspect // 获取参数的信息,传入到数据库中。 setRequestValue(joinPoint, operLog); } + // 是否需要保存response,参数和值 + if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult)) + { + operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000)); + } } /**