提交代码
parent
27db4819ba
commit
75223b9f64
|
@ -2,6 +2,7 @@ package com.ruoyi.framework.aspectj;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import javax.servlet.http.Cookie;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
@ -100,6 +101,13 @@ public class LogAspect
|
||||||
if (loginUser != null)
|
if (loginUser != null)
|
||||||
{
|
{
|
||||||
operLog.setOperName(loginUser.getUsername());
|
operLog.setOperName(loginUser.getUsername());
|
||||||
|
/*********************getAuthentication未获取用户信息时,从cookies中获取操作人信息***************************/
|
||||||
|
}else if(ServletUtils.getRequest().getCookies()!=null && ServletUtils.getRequest().getCookies().length>0){
|
||||||
|
for(Cookie cookie:ServletUtils.getRequest().getCookies()){
|
||||||
|
if(cookie.getName().equals("username")){
|
||||||
|
operLog.setOperName(cookie.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e != null)
|
if (e != null)
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||||
// 过滤请求
|
// 过滤请求
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||||
.antMatchers("/login","/wechatLogin/**", "/register", "/captchaImage", "/weixin/**","/bgscreen/**","/publics/**","/system/dict/data/**").permitAll()
|
.antMatchers("/login","/wechatLogin/**", "/common/**", "/register", "/captchaImage", "/weixin/**","/bgscreen/**","/publics/**","/system/dict/data/**").permitAll()
|
||||||
// 静态资源,可匿名访问
|
// 静态资源,可匿名访问
|
||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/**/img/**", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/**/img/**", "/profile/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||||
|
|
Loading…
Reference in New Issue