From cd0a00736f827c413785db556eef155b116bc40a Mon Sep 17 00:00:00 2001 From: zxm <154040976@qq.com> Date: Thu, 4 Jan 2018 22:04:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=97=A5=E5=BF=97=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=20=E5=AF=B9=E5=8F=82=E6=95=B0=E7=9A=84=E7=9B=91?= =?UTF-8?q?=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/len/controller/UserController.java | 2 +- .../com/len/core/annotation/LogAspect.java | 12 ++++ .../src/main/java/com/len/entity/SysLog.java | 56 +++---------------- .../main/resources/ftl/system/log/logList.ftl | 7 ++- .../main/resources/mapper/SysLogMapper.xml | 18 +++++- 5 files changed, 40 insertions(+), 55 deletions(-) diff --git a/len-sys/src/main/java/com/len/controller/UserController.java b/len-sys/src/main/java/com/len/controller/UserController.java index f0fff33..7420978 100644 --- a/len-sys/src/main/java/com/len/controller/UserController.java +++ b/len-sys/src/main/java/com/len/controller/UserController.java @@ -124,7 +124,7 @@ public class UserController extends BaseController{ } @ApiOperation(value = "/updateUser", httpMethod = "POST", notes = "更新用户") - @Log(desc = "更新用户") + @Log(desc = "更新用户",type = LOG_TYPE.UPDATE) @PostMapping(value = "updateUser") @ResponseBody public JsonUtil updateUser(SysUser user,String role[]) { diff --git a/len-sys/src/main/java/com/len/core/annotation/LogAspect.java b/len-sys/src/main/java/com/len/core/annotation/LogAspect.java index 57f96e7..cf740a8 100644 --- a/len-sys/src/main/java/com/len/core/annotation/LogAspect.java +++ b/len-sys/src/main/java/com/len/core/annotation/LogAspect.java @@ -1,5 +1,6 @@ package com.len.core.annotation; +import com.alibaba.fastjson.JSON; import com.len.base.CurrentUser; import com.len.core.shiro.ShiroUtil; import com.len.entity.SysLog; @@ -53,6 +54,17 @@ public class LogAspect { log.setCreateTime(new Date()); log.setType(type.toString()); log.setText(text); + + Object[] obj= jp.getArgs(); + StringBuffer buffer=new StringBuffer(); + if(obj!=null){ + for(int i=0;i{{ layui.laytpl.toDateString(d.createTime,"yyyy-MM-dd HH:mm:ss") }}'} + , {field: 'type', title: '操作类型', width: '5%', sort: true} + , {field: 'text', title: '描述内容', width: '10%', sort: true} + , {field: 'param', title: '参数', width: '45%', sort: true} + , {field: 'createTime', title: '操作时间', width: '10%',templet: '
{{ layui.laytpl.toDateString(d.createTime,"yyyy-MM-dd HH:mm:ss") }}
'} , {field: 'text', title: '操作', width: '20%', toolbar:'#toolBar'} ]] diff --git a/len-web/src/main/resources/mapper/SysLogMapper.xml b/len-web/src/main/resources/mapper/SysLogMapper.xml index 047c8cf..aa53e59 100644 --- a/len-web/src/main/resources/mapper/SysLogMapper.xml +++ b/len-web/src/main/resources/mapper/SysLogMapper.xml @@ -7,10 +7,11 @@ + - id, user_name, ip, type, text, create_time + id, user_name, ip, type, text, param, create_time