操作日志记录新增请求方式

master
RuoYi 5 years ago committed by Limy
parent a938293c9a
commit 509541defa

@ -22,6 +22,11 @@
<div class="form-control-static" th:text="${operLog.operUrl}"> <div class="form-control-static" th:text="${operLog.operUrl}">
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-2 control-label">请求方式:</label>
<div class="form-control-static" th:text="${operLog.requestMethod}">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">操作方法:</label> <label class="col-sm-2 control-label">操作方法:</label>
<div class="form-control-static" th:text="${operLog.method}"> <div class="form-control-static" th:text="${operLog.method}">

@ -104,6 +104,8 @@ public class LogAspect
String className = joinPoint.getTarget().getClass().getName(); String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName(); String methodName = joinPoint.getSignature().getName();
operLog.setMethod(className + "." + methodName + "()"); operLog.setMethod(className + "." + methodName + "()");
// 设置请求方式
operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
// 处理设置注解上的参数 // 处理设置注解上的参数
getControllerMethodDescription(controllerLog, operLog); getControllerMethodDescription(controllerLog, operLog);
// 保存数据库 // 保存数据库

@ -66,8 +66,8 @@
<label class="col-sm-3 control-label">${comment}</label> <label class="col-sm-3 control-label">${comment}</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}"> <div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}">
<input type="radio" th:id="${'${field}_'+dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:checked="${dict.default}"#if($column.required) required#end> <input type="radio" th:id="${'${field}_' + dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:checked="${dict.default}"#if($column.required) required#end>
<label th:for="${'${field}_'+dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'${field}_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
</div> </div>

@ -66,8 +66,8 @@
<label class="col-sm-3 control-label">${comment}</label> <label class="col-sm-3 control-label">${comment}</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}"> <div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}">
<input type="radio" th:id="${'${field}_'+dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:field="*{${field}}"#if($column.required) required#end> <input type="radio" th:id="${'${field}_' + dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:field="*{${field}}"#if($column.required) required#end>
<label th:for="${'${field}_'+dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'${field}_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
</div> </div>

@ -35,6 +35,10 @@ public class SysOperLog extends BaseEntity
@Excel(name = "请求方法") @Excel(name = "请求方法")
private String method; private String method;
/** 请求方式 */
@Excel(name = "请求方式")
private String requestMethod;
/** 操作类别0其它 1后台用户 2手机端用户 */ /** 操作类别0其它 1后台用户 2手机端用户 */
@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户") @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
private Integer operatorType; private Integer operatorType;
@ -125,6 +129,16 @@ public class SysOperLog extends BaseEntity
this.method = method; this.method = method;
} }
public String getRequestMethod()
{
return requestMethod;
}
public void setRequestMethod(String requestMethod)
{
this.requestMethod = requestMethod;
}
public Integer getOperatorType() public Integer getOperatorType()
{ {
return operatorType; return operatorType;
@ -233,6 +247,7 @@ public class SysOperLog extends BaseEntity
.append("businessType", getBusinessType()) .append("businessType", getBusinessType())
.append("businessTypes", getBusinessTypes()) .append("businessTypes", getBusinessTypes())
.append("method", getMethod()) .append("method", getMethod())
.append("requestMethod", getRequestMethod())
.append("operatorType", getOperatorType()) .append("operatorType", getOperatorType())
.append("operName", getOperName()) .append("operName", getOperName())
.append("deptName", getDeptName()) .append("deptName", getDeptName())

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="title" column="title" /> <result property="title" column="title" />
<result property="businessType" column="business_type" /> <result property="businessType" column="business_type" />
<result property="method" column="method" /> <result property="method" column="method" />
<result property="requestMethod" column="request_method" />
<result property="operatorType" column="operator_type" /> <result property="operatorType" column="operator_type" />
<result property="operName" column="oper_name" /> <result property="operName" column="oper_name" />
<result property="deptName" column="dept_name" /> <result property="deptName" column="dept_name" />
@ -22,13 +23,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectOperLogVo"> <sql id="selectOperLogVo">
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 from sys_oper_log
</sql> </sql>
<insert id="insertOperlog" parameterType="SysOperLog"> <insert id="insertOperlog" parameterType="SysOperLog">
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) 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}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate()) values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())
</insert> </insert>
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult"> <select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">

@ -408,6 +408,7 @@ create table sys_oper_log (
title varchar(50) default '' comment '模块标题', title varchar(50) default '' comment '模块标题',
business_type int(2) default 0 comment '业务类型0其它 1新增 2修改 3删除', business_type int(2) default 0 comment '业务类型0其它 1新增 2修改 3删除',
method varchar(100) default '' comment '方法名称', method varchar(100) default '' comment '方法名称',
request_method varchar(10) default '' comment '请求方式',
operator_type int(1) default 0 comment '操作类别0其它 1后台用户 2手机端用户', operator_type int(1) default 0 comment '操作类别0其它 1后台用户 2手机端用户',
oper_name varchar(50) default '' comment '操作人员', oper_name varchar(50) default '' comment '操作人员',
dept_name varchar(50) default '' comment '部门名称', dept_name varchar(50) default '' comment '部门名称',
Loading…
Cancel
Save