防重放攻击
This commit is contained in:
parent
622e6a0eb0
commit
df76ea9e95
|
|
@ -7,12 +7,16 @@ import java.util.Map;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entity基类
|
* Entity基类
|
||||||
*
|
*
|
||||||
* @author bonus
|
* @author bonus
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
public class BaseEntity implements Serializable
|
public class BaseEntity implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
@ -102,17 +106,14 @@ public class BaseEntity implements Serializable
|
||||||
this.remark = remark;
|
this.remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getParams()
|
public Map<String, Object> getParams() {
|
||||||
{
|
if (params == null) {
|
||||||
if (params == null)
|
|
||||||
{
|
|
||||||
params = new HashMap<>();
|
params = new HashMap<>();
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParams(Map<String, Object> params)
|
public void setParams(Map<String, Object> params) {
|
||||||
{
|
|
||||||
this.params = params;
|
this.params = params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.common.filter;
|
||||||
import com.bonus.common.exception.CaptchaException;
|
import com.bonus.common.exception.CaptchaException;
|
||||||
import com.bonus.common.utils.encryption.Sm3Util;
|
import com.bonus.common.utils.encryption.Sm3Util;
|
||||||
import com.bonus.common.utils.encryption.Sm4Utils;
|
import com.bonus.common.utils.encryption.Sm4Utils;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
|
|
@ -273,9 +274,6 @@ public class RequestCoverFilter implements Filter {
|
||||||
/**
|
/**
|
||||||
* 查询字符串包装类
|
* 查询字符串包装类
|
||||||
*/
|
*/
|
||||||
/**
|
|
||||||
* 查询字符串包装类(支持嵌套参数格式)
|
|
||||||
*/
|
|
||||||
private static class QueryStringRequestWrapper extends HttpServletRequestWrapper {
|
private static class QueryStringRequestWrapper extends HttpServletRequestWrapper {
|
||||||
private final String queryString;
|
private final String queryString;
|
||||||
private Map<String, String[]> cachedParameterMap;
|
private Map<String, String[]> cachedParameterMap;
|
||||||
|
|
@ -337,7 +335,7 @@ public class RequestCoverFilter implements Filter {
|
||||||
String nestedKey = key.substring(7, key.length() - 1);
|
String nestedKey = key.substring(7, key.length() - 1);
|
||||||
|
|
||||||
// 将嵌套参数转换为 params. 前缀的参数
|
// 将嵌套参数转换为 params. 前缀的参数
|
||||||
String paramsKey = nestedKey;
|
String paramsKey = "params[" + nestedKey + "]";
|
||||||
parameterMap.put(paramsKey, new String[]{value});
|
parameterMap.put(paramsKey, new String[]{value});
|
||||||
} else {
|
} else {
|
||||||
// 普通参数处理
|
// 普通参数处理
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue