mirror of
https://gitee.com/myxzgzs/boyue-vue-pro.git
synced 2025-08-08 08:22:45 +08:00
feat:【SYSTEM 系统管理】SecurityFrameworkUtils 的 setLoginUser 方法,移除对 request 强依赖,可用于 Job 记录操作日志;
This commit is contained in:
parent
7fc522938d
commit
bda357508a
@ -126,9 +126,11 @@ public class SecurityFrameworkUtils {
|
|||||||
|
|
||||||
// 额外设置到 request 中,用于 ApiAccessLogFilter 可以获取到用户编号;
|
// 额外设置到 request 中,用于 ApiAccessLogFilter 可以获取到用户编号;
|
||||||
// 原因是,Spring Security 的 Filter 在 ApiAccessLogFilter 后面,在它记录访问日志时,线上上下文已经没有用户编号等信息
|
// 原因是,Spring Security 的 Filter 在 ApiAccessLogFilter 后面,在它记录访问日志时,线上上下文已经没有用户编号等信息
|
||||||
|
if (request != null) {
|
||||||
WebFrameworkUtils.setLoginUserId(request, loginUser.getId());
|
WebFrameworkUtils.setLoginUserId(request, loginUser.getId());
|
||||||
WebFrameworkUtils.setLoginUserType(request, loginUser.getUserType());
|
WebFrameworkUtils.setLoginUserType(request, loginUser.getUserType());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static Authentication buildAuthentication(LoginUser loginUser, HttpServletRequest request) {
|
private static Authentication buildAuthentication(LoginUser loginUser, HttpServletRequest request) {
|
||||||
// 创建 UsernamePasswordAuthenticationToken 对象
|
// 创建 UsernamePasswordAuthenticationToken 对象
|
||||||
|
Loading…
x
Reference in New Issue
Block a user