From 509541defae643c7c478ba1ba25852fc5c21ec97 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 22 Aug 2019 21:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=96=B0=E5=A2=9E=E8=AF=B7=E6=B1=82=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/ruoyi/js/ry-ui.js | 4 +-- .../templates/monitor/operlog/detail.html | 5 +++ .../ruoyi/framework/aspectj/LogAspect.java | 2 ++ .../src/main/resources/vm/html/add.html.vm | 4 +-- .../src/main/resources/vm/html/edit.html.vm | 4 +-- .../com/ruoyi/system/domain/SysOperLog.java | 15 ++++++++ .../mapper/system/SysOperLogMapper.xml | 35 ++++++++++--------- sql/{ry_20190808.sql => ry_20190822.sql} | 1 + 8 files changed, 47 insertions(+), 23 deletions(-) rename sql/{ry_20190808.sql => ry_20190822.sql} (99%) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 36500bbf..d2a91ad7 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -429,9 +429,9 @@ $.bttTable = $('#' + options.id).bootstrapTreeTable({ code: options.code, // 用于设置父子关系 parentCode: options.parentCode, // 用于设置父子关系 - type: 'post', // 请求方式(*) + type: 'post', // 请求方式(*) url: options.url, // 请求后台的URL(*) - data: options.data, // 无url时用于渲染的数据 + data: options.data, // 无url时用于渲染的数据 ajaxParams: options.ajaxParams, // 请求数据的ajax的data属性 rootIdValue: options.rootIdValue, // 设置指定根节点id值 height: options.height, // 表格树的高度 diff --git a/ruoyi-admin/src/main/resources/templates/monitor/operlog/detail.html b/ruoyi-admin/src/main/resources/templates/monitor/operlog/detail.html index 39c6a28a..5781420f 100644 --- a/ruoyi-admin/src/main/resources/templates/monitor/operlog/detail.html +++ b/ruoyi-admin/src/main/resources/templates/monitor/operlog/detail.html @@ -22,6 +22,11 @@
+
+ +
+
+
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 a549c06e..893e9f3e 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 @@ -104,6 +104,8 @@ public class LogAspect String className = joinPoint.getTarget().getClass().getName(); String methodName = joinPoint.getSignature().getName(); operLog.setMethod(className + "." + methodName + "()"); + // 设置请求方式 + operLog.setRequestMethod(ServletUtils.getRequest().getMethod()); // 处理设置注解上的参数 getControllerMethodDescription(controllerLog, operLog); // 保存数据库 diff --git a/ruoyi-generator/src/main/resources/vm/html/add.html.vm b/ruoyi-generator/src/main/resources/vm/html/add.html.vm index 671040ca..8495268e 100644 --- a/ruoyi-generator/src/main/resources/vm/html/add.html.vm +++ b/ruoyi-generator/src/main/resources/vm/html/add.html.vm @@ -66,8 +66,8 @@
- - + +
diff --git a/ruoyi-generator/src/main/resources/vm/html/edit.html.vm b/ruoyi-generator/src/main/resources/vm/html/edit.html.vm index 80b503ba..687d9d10 100644 --- a/ruoyi-generator/src/main/resources/vm/html/edit.html.vm +++ b/ruoyi-generator/src/main/resources/vm/html/edit.html.vm @@ -66,8 +66,8 @@
- - + +
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java index 61250056..07046400 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java @@ -35,6 +35,10 @@ public class SysOperLog extends BaseEntity @Excel(name = "请求方法") private String method; + /** 请求方式 */ + @Excel(name = "请求方式") + private String requestMethod; + /** 操作类别(0其它 1后台用户 2手机端用户) */ @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") private Integer operatorType; @@ -125,6 +129,16 @@ public class SysOperLog extends BaseEntity this.method = method; } + public String getRequestMethod() + { + return requestMethod; + } + + public void setRequestMethod(String requestMethod) + { + this.requestMethod = requestMethod; + } + public Integer getOperatorType() { return operatorType; @@ -233,6 +247,7 @@ public class SysOperLog extends BaseEntity .append("businessType", getBusinessType()) .append("businessTypes", getBusinessTypes()) .append("method", getMethod()) + .append("requestMethod", getRequestMethod()) .append("operatorType", getOperatorType()) .append("operName", getOperName()) .append("deptName", getDeptName()) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml index b75e78dc..a0b52d96 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml @@ -5,30 +5,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - select oper_id, title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time + select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time from sys_oper_log - insert into sys_oper_log(title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time) - values (#{title}, #{businessType}, #{method}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate()) + insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time) + values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())