修复Log注解GET请求记录不到参数问题
This commit is contained in:
		@@ -13,7 +13,6 @@ import org.slf4j.LoggerFactory;
 | 
			
		||||
import org.springframework.stereotype.Component;
 | 
			
		||||
import org.springframework.validation.BindingResult;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
import org.springframework.web.servlet.HandlerMapping;
 | 
			
		||||
import com.alibaba.fastjson2.JSON;
 | 
			
		||||
import com.ruoyi.common.annotation.Log;
 | 
			
		||||
import com.ruoyi.common.core.domain.model.LoginUser;
 | 
			
		||||
@@ -103,7 +102,6 @@ public class LogAspect
 | 
			
		||||
        catch (Exception exp)
 | 
			
		||||
        {
 | 
			
		||||
            // 记录本地异常日志
 | 
			
		||||
            log.error("==前置通知异常==");
 | 
			
		||||
            log.error("异常信息:{}", exp.getMessage());
 | 
			
		||||
            exp.printStackTrace();
 | 
			
		||||
        }
 | 
			
		||||
@@ -153,8 +151,8 @@ public class LogAspect
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            Map<?, ?> paramsMap = (Map<?, ?>) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
 | 
			
		||||
            operLog.setOperParam(StringUtils.substring(paramsMap.toString(), 0, 2000));
 | 
			
		||||
            Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
 | 
			
		||||
            operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter()), 0, 2000));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user