123
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.common.utils;
|
|||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.extra.servlet.ServletUtil;
|
import cn.hutool.extra.servlet.ServletUtil;
|
||||||
|
import cn.hutool.http.Header;
|
||||||
import cn.hutool.http.HttpStatus;
|
import cn.hutool.http.HttpStatus;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
@@ -35,6 +36,7 @@ import java.util.UUID;
|
|||||||
public class ServletUtils extends ServletUtil {
|
public class ServletUtils extends ServletUtil {
|
||||||
|
|
||||||
private final static String HEAD_UUID = "uuid";
|
private final static String HEAD_UUID = "uuid";
|
||||||
|
private final static String USER_AGENT = "User-Agent";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取String参数
|
* 获取String参数
|
||||||
@@ -208,4 +210,7 @@ public class ServletUtils extends ServletUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getUserAgent() {
|
||||||
|
return getRequest().getHeader(USER_AGENT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,10 +90,12 @@ public class LogAspect {
|
|||||||
operLog.setOperName(loginUser.getUsername());
|
operLog.setOperName(loginUser.getUsername());
|
||||||
operLog.setUserType(loginUser.getUserType());
|
operLog.setUserType(loginUser.getUserType());
|
||||||
operLog.setDeptName(loginUser.getDeptName());
|
operLog.setDeptName(loginUser.getDeptName());
|
||||||
|
logString.append(String.format("currentUserId=%s;", loginUser.getUserId()));
|
||||||
}
|
}
|
||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
// not do
|
// not do
|
||||||
}
|
}
|
||||||
|
logString.append(String.format("user-agent=%s;", ServletUtils.getUserAgent()));
|
||||||
// 处理设置注解上的参数
|
// 处理设置注解上的参数
|
||||||
getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult,logString);
|
getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult,logString);
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user