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