Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2026-07-08 14:45:50 +08:00
5 changed files with 19 additions and 0 deletions

View File

@@ -96,6 +96,11 @@ public class OperLogEvent implements Serializable {
*/ */
private String errorMsg; private String errorMsg;
/**
* 页面路由
*/
private String operPage;
/** /**
* 操作时间 * 操作时间
*/ */

View File

@@ -72,6 +72,8 @@ public class LogAspect {
String ip = ServletUtils.getClientIP(); String ip = ServletUtils.getClientIP();
operLog.setOperIp(ip); operLog.setOperIp(ip);
operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255)); operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255));
// 从请求头获取前端页面路由
operLog.setOperPage(StringUtils.substring(ServletUtils.getRequest().getHeader("X-Page-Route"), 0, 255));
operLog.setOperName(LoginHelper.getUsername()); operLog.setOperName(LoginHelper.getUsername());
if (e != null) { if (e != null) {

View File

@@ -133,6 +133,12 @@ public class SysOperLog implements Serializable {
@ExcelProperty(value = "操作时间") @ExcelProperty(value = "操作时间")
private Date operTime; private Date operTime;
/**
* 页面路由
*/
@ExcelProperty(value = "页面路由")
private String operPage;
/** /**
* 请求参数 * 请求参数
*/ */

View File

@@ -14,6 +14,7 @@
<result property="operName" column="oper_name"/> <result property="operName" column="oper_name"/>
<result property="deptName" column="dept_name"/> <result property="deptName" column="dept_name"/>
<result property="operUrl" column="oper_url"/> <result property="operUrl" column="oper_url"/>
<result property="operPage" column="oper_page"/>
<result property="operIp" column="oper_ip"/> <result property="operIp" column="oper_ip"/>
<result property="operLocation" column="oper_location"/> <result property="operLocation" column="oper_location"/>
<result property="operParam" column="oper_param"/> <result property="operParam" column="oper_param"/>

View File

@@ -6,6 +6,7 @@ import errorCode from '@/utils/errorCode'
import { tansParams, blobValidate } from "@/utils/klp"; import { tansParams, blobValidate } from "@/utils/klp";
import cache from '@/plugins/cache' import cache from '@/plugins/cache'
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
import router from '@/router'
let downloadLoadingInstance; let downloadLoadingInstance;
// 是否显示重新登录 // 是否显示重新登录
@@ -85,6 +86,10 @@ service.interceptors.request.use(config => {
} }
} }
} }
// 将当前页面路由放入请求头,供后端操作日志记录
if (router.currentRoute && router.currentRoute.path) {
config.headers['X-Page-Route'] = router.currentRoute.path
}
return config return config
}, error => { }, error => {
console.log(error) console.log(error)