Merge remote-tracking branch 'origin/main'
# Conflicts: # das/src/main/java/com/das/common/interceptor/DecryptingOncePerRequestFilter.java
This commit is contained in:
commit
964e1750d6
@ -21,9 +21,9 @@
|
||||
<maven.plugin.version>3.8.1</maven.plugin.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<mybatis.plus.spring.boot>3.5.5</mybatis.plus.spring.boot>
|
||||
<hutool.version>5.8.18</hutool.version>
|
||||
<hutool.version>5.8.25</hutool.version>
|
||||
|
||||
<postgresql.version>42.2.24</postgresql.version>
|
||||
<postgresql.version>42.7.3</postgresql.version>
|
||||
<sa.version>1.38.0</sa.version>
|
||||
</properties>
|
||||
|
||||
|
@ -31,10 +31,7 @@ public class CaptchaUtil {
|
||||
public static boolean checkVerificationCode(String uuid, String codeAnswer, AdminRedisTemplate adminRedisTemplate){
|
||||
String verifyKey = AdminConstant.CAPTCHA_CODE_KEY + uuid;
|
||||
String answer = adminRedisTemplate.get(verifyKey);
|
||||
if (StrUtil.isNotEmpty(codeAnswer) && answer != null && answer.equals(codeAnswer)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return StrUtil.isNotEmpty(codeAnswer) && answer != null && answer.equals(codeAnswer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -122,7 +122,7 @@ public class DecryptingOncePerRequestFilter extends OncePerRequestFilter {
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getHeaders(String name) {
|
||||
Set<String> set = new HashSet<>();
|
||||
Set<String> set = new HashSet<>(8);
|
||||
if (TOKEN_ATTR_NAME.equals(name) && StrUtil.isNotBlank(token)){
|
||||
set.add(token);
|
||||
}
|
||||
@ -136,7 +136,7 @@ public class DecryptingOncePerRequestFilter extends OncePerRequestFilter {
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getHeaderNames() {
|
||||
Set<String> set = new HashSet<>();
|
||||
Set<String> set = new HashSet<>(8);
|
||||
Enumeration<String> e = super.getHeaderNames();
|
||||
while (e.hasMoreElements()) {
|
||||
String n = e.nextElement();
|
||||
|
@ -8,7 +8,7 @@ import java.util.Enumeration;
|
||||
|
||||
public class TokenUpdatingHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private String newTokenValue;
|
||||
private final String newTokenValue;
|
||||
|
||||
public TokenUpdatingHttpServletRequestWrapper(HttpServletRequest request, String newTokenValue) {
|
||||
super(request);
|
||||
@ -31,4 +31,4 @@ public class TokenUpdatingHttpServletRequestWrapper extends HttpServletRequestWr
|
||||
return super.getHeaders(name); // 对于其他header,委托给父类处理
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import java.util.concurrent.Executor;
|
||||
@Slf4j
|
||||
public class MdcExecutor implements Executor {
|
||||
|
||||
private Executor executor;
|
||||
private final Executor executor;
|
||||
|
||||
public MdcExecutor(Executor executor) {
|
||||
this.executor = executor;
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class JsonUtils {
|
||||
|
||||
private static ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class);
|
||||
private static final ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class);
|
||||
|
||||
public static ObjectMapper getObjectMapper() {
|
||||
return OBJECT_MAPPER;
|
||||
|
@ -87,10 +87,17 @@
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"success": true,
|
||||
"data": {
|
||||
"token": "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImMyNjg3ZGI4LWJkNmItNGE3OC05MTI0LWMyNDk2NzNlNTZkOSJ9.NXnDQyHdJcz8md95DLkETJqY91048X2X_yPcCRRejLRf0p0Nz1cC4kNti0RAE5PdX477O3d27a35S4C2_VM54Q"
|
||||
}
|
||||
"sysUser": {
|
||||
"id": 1,
|
||||
"account": "admin",
|
||||
"userName": "admin"
|
||||
},
|
||||
"refreshToken": "6dfa2fe87b0d44538e26481c01c02d16",
|
||||
"token": "85487b052fd34c36a0482be56e8532f0"
|
||||
},
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user