style: 优化全局代码格式

This commit is contained in:
2024-01-10 21:24:02 +08:00
parent ab19c05f00
commit 57c21a9109
51 changed files with 627 additions and 186 deletions

View File

@@ -40,8 +40,7 @@ public class JustAuthStateCacheRedisImpl implements AuthStateCache {
@Override
public void cache(String key, String value) {
// 参考:在 JustAuth 中,内置了一个基于 map 的 state 缓存器,默认缓存有效期为 3 分钟
RedisUtils.set(RedisUtils.formatKey(KEY_PREFIX, key), value,
Duration.ofMinutes(3));
RedisUtils.set(RedisUtils.formatKey(KEY_PREFIX, key), value, Duration.ofMinutes(3));
}
/**
@@ -53,8 +52,7 @@ public class JustAuthStateCacheRedisImpl implements AuthStateCache {
*/
@Override
public void cache(String key, String value, long timeout) {
RedisUtils.set(RedisUtils.formatKey(KEY_PREFIX, key), value,
Duration.ofMillis(timeout));
RedisUtils.set(RedisUtils.formatKey(KEY_PREFIX, key), value, Duration.ofMillis(timeout));
}
/**

View File

@@ -57,8 +57,9 @@ public class SaTokenAutoConfiguration implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin())).addPathPatterns(StringConstants.PATH_PATTERN)
.excludePathPatterns(properties.getSecurity().getExcludes());
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin()))
.addPathPatterns(StringConstants.PATH_PATTERN)
.excludePathPatterns(properties.getSecurity().getExcludes());
}
/**

View File

@@ -23,7 +23,6 @@ import org.springframework.boot.context.properties.NestedConfigurationProperty;
import top.charles7c.continew.starter.auth.satoken.properties.SaTokenDaoProperties;
import top.charles7c.continew.starter.auth.satoken.properties.SaTokenSecurityProperties;
/**
* SaToken 扩展配置属性
*