BF-202308171519\Administrator 2 роки тому
батько
коміт
9974a08b9f
100 змінених файлів з 428 додано та 471 видалено
  1. 0 1
      kxs-codegen/src/main/java/com/kxs/codegen/biz/KxsCodeGenApplication.java
  2. 0 1
      kxs-codegen/src/main/java/com/kxs/codegen/biz/service/impl/GenTableServiceImpl.java
  3. 1 2
      kxs-codegen/src/main/java/com/kxs/codegen/biz/service/impl/GeneratorServiceImpl.java
  4. 1 5
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/config/JacksonConfiguration.java
  5. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/config/RedisTemplateConfiguration.java
  6. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/CommonConstants.java
  7. 1 0
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/SecurityConstants.java
  8. 1 4
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/ServiceNameConstants.java
  9. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/enums/DictTypeEnum.java
  10. 11 24
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/enums/ErrorTypeEnum.java
  11. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/enums/LoginTypeEnum.java
  12. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/enums/MenuTypeEnum.java
  13. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/AccessDeniedBizException.java
  14. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/AesDecodeException.java
  15. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/CheckedException.java
  16. 104 108
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/GlobalBizExceptionHandler.java
  17. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/ValidateCodeException.java
  18. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/jackson/SkyJavaTimeModule.java
  19. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/ClassUtils.java
  20. 0 2
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/R.java
  21. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/RedisUtils.java
  22. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/RetOps.java
  23. 0 1
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/SpringContextHolder.java
  24. 4 3
      kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/WebUtils.java
  25. 1 1
      kxs-common/kxs-common-datasource/src/main/java/com/kxs/common/datasource/DynamicDataSourceAutoConfiguration.java
  26. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/LogAutoConfiguration.java
  27. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/annotation/SysLog.java
  28. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/aspect/SysLogAspect.java
  29. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/config/SkyLogProperties.java
  30. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/event/SysLogEvent.java
  31. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/event/SysLogEventSource.java
  32. 2 4
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/event/SysLogListener.java
  33. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/init/ApplicationLoggerInitializer.java
  34. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/util/LogTypeEnum.java
  35. 0 1
      kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/util/SysLogUtils.java
  36. 0 1
      kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/MybatisAutoConfiguration.java
  37. 0 1
      kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/base/BaseEntity.java
  38. 0 1
      kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/config/MybatisPlusMetaObjectHandler.java
  39. 0 1
      kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/handler/JsonLongArrayTypeHandler.java
  40. 0 1
      kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/handler/JsonStringArrayTypeHandler.java
  41. 0 1
      kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/plugins/SkyPaginationInnerInterceptor.java
  42. 4 5
      kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/resolver/SqlFilterArgumentResolver.java
  43. 1 2
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/annotation/EnableAuthResourceServer.java
  44. 0 1
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/annotation/EnableLoginResourceServer.java
  45. 1 2
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/annotation/Inner.java
  46. 13 13
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/AuthResourceServerConfiguration.java
  47. 0 1
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/PermissionService.java
  48. 2 2
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/PermitAllUrlProperties.java
  49. 0 1
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/ResourceAuthExceptionEntryPoint.java
  50. 0 2
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyBearerTokenExtractor.java
  51. 2 2
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyCustomOAuth2AccessTokenResponseHttpMessageConverter.java
  52. 1 1
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyCustomOpaqueTokenIntrospector.java
  53. 0 1
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyResourceServerAutoConfiguration.java
  54. 19 19
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyResourceServerConfiguration.java
  55. 2 3
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/model/KxsUser.java
  56. 6 7
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/service/KxsRemoteRegisteredClientRepository.java
  57. 0 2
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/service/KxsUserDetailsService.java
  58. 8 9
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/service/KxsUserDetailsServiceImpl.java
  59. 3 3
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/CustomeOAuth2AccessTokenGenerator.java
  60. 11 12
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java
  61. 2 3
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/core/SkyDaoAuthenticationProvider.java
  62. 3 2
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/handler/FormAuthenticationFailureHandler.java
  63. 2 1
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/handler/SkyAuthenticationSuccessEventHandler.java
  64. 3 5
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/util/OAuth2EndpointUtils.java
  65. 0 1
      kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/util/SecurityUtils.java
  66. 15 18
      kxs-gateway/src/main/java/com/kxs/gateway/api/config/AesCryptoConfig.java
  67. 2 3
      kxs-gateway/src/main/java/com/kxs/gateway/api/config/GatewayConfiguration.java
  68. 2 1
      kxs-gateway/src/main/java/com/kxs/gateway/api/config/RateLimiterConfiguration.java
  69. 4 5
      kxs-gateway/src/main/java/com/kxs/gateway/api/config/RouterFunctionConfiguration.java
  70. 21 17
      kxs-gateway/src/main/java/com/kxs/gateway/api/filter/RequestDecoderFilter.java
  71. 2 2
      kxs-gateway/src/main/java/com/kxs/gateway/api/filter/ValidateCodeGatewayFilter.java
  72. 5 5
      kxs-gateway/src/main/java/com/kxs/gateway/api/handler/ImageCodeHandler.java
  73. 13 0
      kxs-gateway/src/main/resources/application-dev.yml
  74. 13 0
      kxs-gateway/src/main/resources/application-prod.yml
  75. 13 0
      kxs-gateway/src/main/resources/application-test.yml
  76. 5 13
      kxs-gateway/src/main/resources/application.yml
  77. 10 0
      kxs-quartz/src/main/resources/application-dev.yml
  78. 10 0
      kxs-quartz/src/main/resources/application-prod.yml
  79. 10 0
      kxs-quartz/src/main/resources/application-test.yml
  80. 2 0
      kxs-quartz/src/main/resources/application.yml
  81. 1 2
      kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/feign/RemoteClientDetailsService.java
  82. 1 3
      kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/feign/RemoteLogService.java
  83. 0 1
      kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/feign/RemoteUserService.java
  84. 73 78
      kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/feign/config/AdminFeignClientConfiguration.java
  85. 0 1
      kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/vo/PreLogVO.java
  86. 0 1
      kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/vo/UserVO.java
  87. 1 1
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/KxsAdminApplication.java
  88. 6 12
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/constant/enums/ErrorTypeEnum.java
  89. 7 6
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/LoginController.java
  90. 0 1
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysClientController.java
  91. 0 1
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysDictController.java
  92. 0 1
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysLogController.java
  93. 0 1
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysMenuController.java
  94. 0 2
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysPostController.java
  95. 0 1
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysPublicParamController.java
  96. 0 2
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysRoleController.java
  97. 0 3
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysUserController.java
  98. 3 4
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/TokenController.java
  99. 0 1
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/mapper/SysDeptMapper.java
  100. 0 1
      kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/mapper/SysDictItemMapper.java

+ 0 - 1
kxs-codegen/src/main/java/com/kxs/codegen/biz/KxsCodeGenApplication.java

@@ -1,5 +1,4 @@
 
-
 package com.kxs.codegen.biz;
 
 import com.kxs.common.datasource.annotation.EnableDynamicDataSource;

+ 0 - 1
kxs-codegen/src/main/java/com/kxs/codegen/biz/service/impl/GenTableServiceImpl.java

@@ -187,7 +187,6 @@ public class GenTableServiceImpl extends ServiceImpl<GenTableMapper, GenTable> i
 			genTableColumnEntity.setFormItem(BoolFillEnum.TRUE.getValue());
 			genTableColumnEntity.setGridItem(BoolFillEnum.TRUE.getValue());
 
-
 			// 审计字段处理
 			if (EnumUtil.contains(CommonColumnFiledEnum.class, columnName)) {
 				CommonColumnFiledEnum commonColumnFiledEnum = CommonColumnFiledEnum.valueOf(columnName);

+ 1 - 2
kxs-codegen/src/main/java/com/kxs/codegen/biz/service/impl/GeneratorServiceImpl.java

@@ -224,8 +224,7 @@ public class GeneratorServiceImpl implements GeneratorService {
 		// 按字段类型分组,使用 Map 存储不同类型的字段列表
 		Map<Boolean, List<GenTableColumnEntity>> typeMap = table.getFieldList()
 			.stream()
-			.collect(Collectors
-				.partitioningBy(columnEntity -> BooleanUtil.toBoolean(columnEntity.getPrimaryPk())));
+			.collect(Collectors.partitioningBy(columnEntity -> BooleanUtil.toBoolean(columnEntity.getPrimaryPk())));
 
 		// 从分组后的 Map 中获取不同类型的字段列表
 		List<GenTableColumnEntity> primaryList = typeMap.get(true);

+ 1 - 5
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/config/JacksonConfiguration.java

@@ -20,11 +20,8 @@ import java.time.format.DateTimeFormatter;
 import java.util.Locale;
 import java.util.TimeZone;
 
-
 /**
- * JacksonConfig
- * 配置一些序列化场景,雪花id转字符串等
- * 长数字精度丢失问题
+ * JacksonConfig 配置一些序列化场景,雪花id转字符串等 长数字精度丢失问题
  *
  * @author 没秃顶的码农
  * @date 2023/11/08
@@ -34,7 +31,6 @@ import java.util.TimeZone;
 @AutoConfigureBefore(JacksonAutoConfiguration.class)
 public class JacksonConfiguration {
 
-
 	@Bean
 	@ConditionalOnMissingBean
 	public Jackson2ObjectMapperBuilderCustomizer customizer() {

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/config/RedisTemplateConfiguration.java

@@ -11,7 +11,6 @@ import org.springframework.data.redis.connection.RedisConnectionFactory;
 import org.springframework.data.redis.core.*;
 import org.springframework.data.redis.serializer.RedisSerializer;
 
-
 /**
  * Redis 配置类
  *

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/CommonConstants.java

@@ -1,7 +1,6 @@
 
 package com.kxs.common.core.constant;
 
-
 /**
  * 公共常量
  *

+ 1 - 0
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/SecurityConstants.java

@@ -126,4 +126,5 @@ public interface SecurityConstants {
 	 * 项目的license
 	 */
 	String PROJECT_LICENSE = "https://com";
+
 }

+ 1 - 4
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/ServiceNameConstants.java

@@ -1,10 +1,7 @@
 package com.kxs.common.core.constant;
 
-
 /**
- * 服务名称
- * 远程调用地址管理
- * 如果用注册中心后,此处只用写服务名称
+ * 服务名称 远程调用地址管理 如果用注册中心后,此处只用写服务名称
  *
  * @author 没秃顶的码农
  * @date 2023/11/12

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/enums/DictTypeEnum.java

@@ -3,7 +3,6 @@ package com.kxs.common.core.constant.enums;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 
-
 /**
  * <p>
  * 字典类型

+ 11 - 24
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/enums/ErrorTypeEnum.java

@@ -12,33 +12,20 @@ import lombok.RequiredArgsConstructor;
 @Getter
 @RequiredArgsConstructor
 public enum ErrorTypeEnum {
-    DECRYPT_ERROR(-1, "解密异常"),
-    TOKEN_EXPIRED(-1, "令牌已过期"),
-    TOKEN_EMPTY(-1, "令牌不存在"),
-    CLIENT_NULL(-1, "客户端查询异常,请检查数据库链接"),
-    ACCESS_DENIED(-1, "不允许范访问"),
-    BAD_CREDENTIALS(-1, "用户名或密码错误"),
-    CREDENTIALS_EXPIRED(-1, "用户凭证已过期"),
-    USER_DISABLED(-1, "用户已失效"),
-    ACCOUNT_DISABLED(-1, "用户帐号已过期"),
-    ACCOUNT_LOCKED(-1, "用户帐号已被锁定"),
-    USER_NOT_FOUND(-1, "未找到用户"),
-    PHONE_NOT_FOUND(-1, "手机号不存在"),
-    VERIFICATION_CODE_IS_ILLEGAL(-1, "验证码不合法"),
-    VERIFICATION_CODE_IS_EMPTY(-1, "验证码不能为空"),
-    UNAUTHORIZED_CLIENT(-1, "客户端不允许登陆"),
 
+	DECRYPT_ERROR(-1, "解密异常"), TOKEN_EXPIRED(-1, "令牌已过期"), TOKEN_EMPTY(-1, "令牌不存在"),
+	CLIENT_NULL(-1, "客户端查询异常,请检查数据库链接"), ACCESS_DENIED(-1, "不允许范访问"), BAD_CREDENTIALS(-1, "用户名或密码错误"),
+	CREDENTIALS_EXPIRED(-1, "用户凭证已过期"), USER_DISABLED(-1, "用户已失效"), ACCOUNT_DISABLED(-1, "用户帐号已过期"),
+	ACCOUNT_LOCKED(-1, "用户帐号已被锁定"), USER_NOT_FOUND(-1, "未找到用户"), PHONE_NOT_FOUND(-1, "手机号不存在"),
+	VERIFICATION_CODE_IS_ILLEGAL(-1, "验证码不合法"), VERIFICATION_CODE_IS_EMPTY(-1, "验证码不能为空"),
+	UNAUTHORIZED_CLIENT(-1, "客户端不允许登陆"),
 
+	SYS_PARAM_DELETE_SYSTEM(-1, "系统内置参数不能删除"), SYS_DICT_DELETE_SYSTEM(-1, "系统内置字典不允许删除"),
+	SYS_MENU_DELETE_EXISTING(-1, "菜单存在下级节点 删除失败"), SYS_USER_USERNAME_EXISTING(-1, "用户名已存在"),
+	SYS_USER_UPDATE_PASSWORD_ERROR(-1, "用户原密码错误"), SYS_DICT_UPDATE_SYSTEM(-1, "系统内置字典不能修改");
 
-    SYS_PARAM_DELETE_SYSTEM(-1, "系统内置参数不能删除"),
-    SYS_DICT_DELETE_SYSTEM(-1, "系统内置字典不允许删除"),
-    SYS_MENU_DELETE_EXISTING(-1, "菜单存在下级节点 删除失败"),
-    SYS_USER_USERNAME_EXISTING(-1, "用户名已存在"),
-    SYS_USER_UPDATE_PASSWORD_ERROR(-1, "用户原密码错误"),
-    SYS_DICT_UPDATE_SYSTEM(-1, "系统内置字典不能修改");
+	private final int code;
 
+	private final String description;
 
-    private final int code;
-
-    private final String description;
 }

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/enums/LoginTypeEnum.java

@@ -3,7 +3,6 @@ package com.kxs.common.core.constant.enums;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 
-
 /**
  * <p>
  * 社交登录类型

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/constant/enums/MenuTypeEnum.java

@@ -3,7 +3,6 @@ package com.kxs.common.core.constant.enums;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 
-
 /**
  * <p>
  * 菜单类型

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/AccessDeniedBizException.java

@@ -1,7 +1,6 @@
 
 package com.kxs.common.core.exception;
 
-
 import java.io.Serial;
 
 /**

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/AesDecodeException.java

@@ -1,7 +1,6 @@
 
 package com.kxs.common.core.exception;
 
-
 import java.io.Serial;
 
 /**

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/CheckedException.java

@@ -5,7 +5,6 @@ import lombok.NoArgsConstructor;
 
 import java.io.Serial;
 
-
 /**
  * 检查异常
  *

+ 104 - 108
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/GlobalBizExceptionHandler.java

@@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
 import java.nio.file.AccessDeniedException;
 import java.util.List;
 
-
 /**
  * <p>
  * 全局异常处理器
@@ -29,112 +28,109 @@ import java.util.List;
 @Order(10000)
 public class GlobalBizExceptionHandler {
 
-    /**
-     * 全局异常.
-     * @param e the e
-     * @return R
-     */
-    @ExceptionHandler(Exception.class)
-    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
-    public R handleGlobalException(Exception e) {
-        log.error("全局异常信息 ex={}", e.getMessage(), e);
-
-        return R.failed(e.getLocalizedMessage());
-    }
-
-    /**
-     * 运行时异常.
-     * @param e the e
-     * @return R
-     */
-    @ExceptionHandler(RuntimeException.class)
-    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
-    public R handleGlobalRuntimeException(RuntimeException e) {
-        log.error("运行时异常 ex={}", e.getMessage(), e);
-
-        return R.failed(e.getMessage());
-    }
-
-    /**
-     * 处理业务校验过程中碰到的非法参数异常 该异常基本由{@link Assert}抛出
-     * @see Assert#hasLength(String, String)
-     * @see Assert#hasText(String, String)
-     * @see Assert#isTrue(boolean, String)
-     * @see Assert#isNull(Object, String)
-     * @see Assert#notNull(Object, String)
-     * @param exception 参数校验异常
-     * @return API返回结果对象包装后的错误输出结果
-     */
-    @ExceptionHandler(IllegalArgumentException.class)
-    @ResponseStatus(HttpStatus.OK)
-    public R handleIllegalArgumentException(IllegalArgumentException exception) {
-        log.error("非法参数,ex = {}", exception.getMessage(), exception);
-        return R.failed(exception.getMessage());
-    }
-
-    /**
-     * AccessDeniedException
-     * @param e the e
-     * @return R
-     */
-    @ExceptionHandler(AccessDeniedBizException.class)
-    @ResponseStatus(HttpStatus.FORBIDDEN)
-    public R handleAccessDeniedException(AccessDeniedBizException e) {
-        log.warn("拒绝授权异常信息 ex={}", "Access is denied");
-        return R.failed(e.getLocalizedMessage());
-    }
-
-    /**
-     * validation Exception
-     * @param exception
-     * @return R
-     */
-    @ExceptionHandler({ MethodArgumentNotValidException.class })
-    @ResponseStatus(HttpStatus.BAD_REQUEST)
-    public R handleBodyValidException(MethodArgumentNotValidException exception) {
-        List<FieldError> fieldErrors = exception.getBindingResult().getFieldErrors();
-        log.warn("参数绑定异常,ex = {}", fieldErrors.get(0).getDefaultMessage());
-        return R.failed(String.format("%s %s", fieldErrors.get(0).getField(), fieldErrors.get(0).getDefaultMessage()));
-    }
-
-    /**
-     * validation Exception (以form-data形式传参)
-     * @param exception
-     * @return R
-     */
-    @ExceptionHandler({ BindException.class })
-    @ResponseStatus(HttpStatus.BAD_REQUEST)
-    public R bindExceptionHandler(BindException exception) {
-        List<FieldError> fieldErrors = exception.getBindingResult().getFieldErrors();
-        log.warn("参数绑定异常,ex = {}", fieldErrors.get(0).getDefaultMessage());
-        return R.failed(fieldErrors.get(0).getDefaultMessage());
-    }
-
-
-    /**
-     * validationCode Exception
-     *
-     * @param exception 异常
-     * @return R
-     */
-    @ExceptionHandler({ValidateCodeException.class })
-    @ResponseStatus(HttpStatus.OK)
-    public R bindValidateCodeHandler(ValidateCodeException exception) {
-        log.warn("验证码异常:{}", exception.getMessage());
-        return R.failed(exception.getMessage());
-    }
-
-    /**
-     * aes 解密 Exception
-     *
-     * @param exception 异常
-     * @return R
-     */
-    @ExceptionHandler({AesDecodeException.class })
-    @ResponseStatus(HttpStatus.OK)
-    public R<Object> bindAesDecodeException(AesDecodeException exception) {
-        log.error("解密异常:{}", exception.getMessage(),exception);
-        return R.failed(exception.getMessage());
-    }
+	/**
+	 * 全局异常.
+	 * @param e the e
+	 * @return R
+	 */
+	@ExceptionHandler(Exception.class)
+	@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+	public R handleGlobalException(Exception e) {
+		log.error("全局异常信息 ex={}", e.getMessage(), e);
+
+		return R.failed(e.getLocalizedMessage());
+	}
+
+	/**
+	 * 运行时异常.
+	 * @param e the e
+	 * @return R
+	 */
+	@ExceptionHandler(RuntimeException.class)
+	@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+	public R handleGlobalRuntimeException(RuntimeException e) {
+		log.error("运行时异常 ex={}", e.getMessage(), e);
+
+		return R.failed(e.getMessage());
+	}
+
+	/**
+	 * 处理业务校验过程中碰到的非法参数异常 该异常基本由{@link Assert}抛出
+	 * @see Assert#hasLength(String, String)
+	 * @see Assert#hasText(String, String)
+	 * @see Assert#isTrue(boolean, String)
+	 * @see Assert#isNull(Object, String)
+	 * @see Assert#notNull(Object, String)
+	 * @param exception 参数校验异常
+	 * @return API返回结果对象包装后的错误输出结果
+	 */
+	@ExceptionHandler(IllegalArgumentException.class)
+	@ResponseStatus(HttpStatus.OK)
+	public R handleIllegalArgumentException(IllegalArgumentException exception) {
+		log.error("非法参数,ex = {}", exception.getMessage(), exception);
+		return R.failed(exception.getMessage());
+	}
+
+	/**
+	 * AccessDeniedException
+	 * @param e the e
+	 * @return R
+	 */
+	@ExceptionHandler(AccessDeniedBizException.class)
+	@ResponseStatus(HttpStatus.FORBIDDEN)
+	public R handleAccessDeniedException(AccessDeniedBizException e) {
+		log.warn("拒绝授权异常信息 ex={}", "Access is denied");
+		return R.failed(e.getLocalizedMessage());
+	}
+
+	/**
+	 * validation Exception
+	 * @param exception
+	 * @return R
+	 */
+	@ExceptionHandler({ MethodArgumentNotValidException.class })
+	@ResponseStatus(HttpStatus.BAD_REQUEST)
+	public R handleBodyValidException(MethodArgumentNotValidException exception) {
+		List<FieldError> fieldErrors = exception.getBindingResult().getFieldErrors();
+		log.warn("参数绑定异常,ex = {}", fieldErrors.get(0).getDefaultMessage());
+		return R.failed(String.format("%s %s", fieldErrors.get(0).getField(), fieldErrors.get(0).getDefaultMessage()));
+	}
+
+	/**
+	 * validation Exception (以form-data形式传参)
+	 * @param exception
+	 * @return R
+	 */
+	@ExceptionHandler({ BindException.class })
+	@ResponseStatus(HttpStatus.BAD_REQUEST)
+	public R bindExceptionHandler(BindException exception) {
+		List<FieldError> fieldErrors = exception.getBindingResult().getFieldErrors();
+		log.warn("参数绑定异常,ex = {}", fieldErrors.get(0).getDefaultMessage());
+		return R.failed(fieldErrors.get(0).getDefaultMessage());
+	}
+
+	/**
+	 * validationCode Exception
+	 * @param exception 异常
+	 * @return R
+	 */
+	@ExceptionHandler({ ValidateCodeException.class })
+	@ResponseStatus(HttpStatus.OK)
+	public R bindValidateCodeHandler(ValidateCodeException exception) {
+		log.warn("验证码异常:{}", exception.getMessage());
+		return R.failed(exception.getMessage());
+	}
+
+	/**
+	 * aes 解密 Exception
+	 * @param exception 异常
+	 * @return R
+	 */
+	@ExceptionHandler({ AesDecodeException.class })
+	@ResponseStatus(HttpStatus.OK)
+	public R<Object> bindAesDecodeException(AesDecodeException exception) {
+		log.error("解密异常:{}", exception.getMessage(), exception);
+		return R.failed(exception.getMessage());
+	}
 
 }

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/exception/ValidateCodeException.java

@@ -1,7 +1,6 @@
 
 package com.kxs.common.core.exception;
 
-
 import java.io.Serial;
 
 /**

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/jackson/SkyJavaTimeModule.java

@@ -18,7 +18,6 @@ import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
 
-
 /**
  * java 8 时间默认序列化
  *

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/ClassUtils.java

@@ -14,7 +14,6 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 
-
 /**
  * 类工具类
  *

+ 0 - 2
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/R.java

@@ -8,12 +8,10 @@ import lombok.experimental.Accessors;
 import java.io.Serial;
 import java.io.Serializable;
 
-
 /**
  * 响应信息主体
  *
  * @param <T>
- *
  * @author 没秃顶的码农
  * @date 2023/10/29
  */

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/RedisUtils.java

@@ -11,7 +11,6 @@ import org.springframework.data.redis.core.script.RedisScript;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 
-
 /**
  * 缓存工具类
  *

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/RetOps.java

@@ -11,7 +11,6 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Predicate;
 
-
 /**
  *
  * 简化{@code R<T>} 的访问操作,例子 <pre>

+ 0 - 1
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/SpringContextHolder.java

@@ -10,7 +10,6 @@ import org.springframework.context.ApplicationEvent;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
-
 /**
  * Spring 工具类
  *

+ 4 - 3
kxs-common/kxs-common-core/src/main/java/com/kxs/common/core/util/WebUtils.java

@@ -21,7 +21,6 @@ import java.nio.charset.StandardCharsets;
 import java.util.Objects;
 import java.util.Optional;
 
-
 /**
  * Miscellaneous utilities for web applications.
  *
@@ -99,7 +98,8 @@ public class WebUtils extends org.springframework.web.util.WebUtils {
 	 */
 	public Optional<HttpServletRequest> getRequest() {
 		return Optional
-			.of(((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest());
+			.of(((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes()))
+				.getRequest());
 	}
 
 	/**
@@ -107,7 +107,8 @@ public class WebUtils extends org.springframework.web.util.WebUtils {
 	 * @return {HttpServletResponse}
 	 */
 	public HttpServletResponse getResponse() {
-		return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getResponse();
+		return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes()))
+			.getResponse();
 	}
 
 	/**

+ 1 - 1
kxs-common/kxs-common-datasource/src/main/java/com/kxs/common/datasource/DynamicDataSourceAutoConfiguration.java

@@ -44,7 +44,7 @@ public class DynamicDataSourceAutoConfiguration {
 	 */
 	@Bean
 	public DynamicDataSourceProvider dynamicDataSourceProvider(DefaultDataSourceCreator defaultDataSourceCreator,
-															   StringEncryptor stringEncryptor, DataSourceProperties properties) {
+			StringEncryptor stringEncryptor, DataSourceProperties properties) {
 		return new JdbcDynamicDataSourceProvider(defaultDataSourceCreator, stringEncryptor, properties);
 	}
 

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/LogAutoConfiguration.java

@@ -10,7 +10,6 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableAsync;
 
-
 /**
  * 日志自动配置
  *

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/annotation/SysLog.java

@@ -2,7 +2,6 @@ package com.kxs.common.log.annotation;
 
 import java.lang.annotation.*;
 
-
 /**
  * 操作日志注解
  *

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/aspect/SysLogAspect.java

@@ -16,7 +16,6 @@ import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.reflect.MethodSignature;
 import org.springframework.expression.EvaluationContext;
 
-
 /**
  * 操作日志使用spring event异步入库
  *

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/config/SkyLogProperties.java

@@ -7,7 +7,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
 
 import java.util.List;
 
-
 /**
  * 日志配置类
  *

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/event/SysLogEvent.java

@@ -3,7 +3,6 @@ package com.kxs.common.log.event;
 import com.kxs.system.api.model.SysLog;
 import org.springframework.context.ApplicationEvent;
 
-
 /**
  * 系统日志事件
  *

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/event/SysLogEventSource.java

@@ -4,7 +4,6 @@ import com.kxs.system.api.model.SysLog;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-
 /**
  * sys日志事件源
  *

+ 2 - 4
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/event/SysLogListener.java

@@ -22,7 +22,6 @@ import org.springframework.scheduling.annotation.Async;
 
 import java.util.Objects;
 
-
 /**
  * 异步监听日志事件
  *
@@ -55,7 +54,7 @@ public class SysLogListener implements InitializingBean {
 			sysLog.setParams(StrUtil.subPre(params, logProperties.getMaxLength()));
 		}
 		log.info("保存日志:{}", sysLog);
-        remoteLogService.saveLog(sysLog, SecurityConstants.FROM_IN);
+		remoteLogService.saveLog(sysLog, SecurityConstants.FROM_IN);
 	}
 
 	@Override
@@ -70,8 +69,7 @@ public class SysLogListener implements InitializingBean {
 	}
 
 	@JsonFilter("filter properties by name")
-	static
-	class PropertyFilterMixIn {
+	static class PropertyFilterMixIn {
 
 	}
 

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/init/ApplicationLoggerInitializer.java

@@ -5,7 +5,6 @@ import org.springframework.boot.env.EnvironmentPostProcessor;
 import org.springframework.core.Ordered;
 import org.springframework.core.env.ConfigurableEnvironment;
 
-
 /**
  * <p>
  * 通过环境变量的形式注入 logging.file 自动维护 Spring Boot Admin Logger Viewer

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/util/LogTypeEnum.java

@@ -3,7 +3,6 @@ package com.kxs.common.log.util;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 
-
 /**
  * <p>
  * 日志类型

+ 0 - 1
kxs-common/kxs-common-log/src/main/java/com/kxs/common/log/util/SysLogUtils.java

@@ -27,7 +27,6 @@ import java.lang.reflect.Method;
 import java.util.Map;
 import java.util.Objects;
 
-
 /**
  * 系统日志工具类
  *

+ 0 - 1
kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/MybatisAutoConfiguration.java

@@ -12,7 +12,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 import java.util.List;
 
-
 /**
  * <p>
  * mybatis plus 统一配置

+ 0 - 1
kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/base/BaseEntity.java

@@ -9,7 +9,6 @@ import lombok.Setter;
 import java.io.Serializable;
 import java.time.LocalDateTime;
 
-
 /**
  * 抽象实体
  *

+ 0 - 1
kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/config/MybatisPlusMetaObjectHandler.java

@@ -14,7 +14,6 @@ import java.nio.charset.Charset;
 import java.time.LocalDateTime;
 import java.util.Optional;
 
-
 /**
  * MybatisPlus 自动填充配置
  *

+ 0 - 1
kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/handler/JsonLongArrayTypeHandler.java

@@ -14,7 +14,6 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-
 /**
  * Mybatis数组,符串互转
  * <p>

+ 0 - 1
kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/handler/JsonStringArrayTypeHandler.java

@@ -14,7 +14,6 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-
 /**
  * Mybatis数组,符串互转
  * <p>

+ 0 - 1
kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/plugins/SkyPaginationInnerInterceptor.java

@@ -16,7 +16,6 @@ import org.apache.ibatis.session.RowBounds;
 
 import java.sql.SQLException;
 
-
 /**
  * 分页拦截器
  * <p>

+ 4 - 5
kxs-common/kxs-common-mybatis/src/main/java/com/kxs/common/mybatis/resolver/SqlFilterArgumentResolver.java

@@ -15,7 +15,6 @@ import java.util.*;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
-
 /**
  * <p>
  * 解决Mybatis Plus Order By SQL注入问题
@@ -70,11 +69,11 @@ public class SqlFilterArgumentResolver implements HandlerMethodArgumentResolver
 
 		List<OrderItem> orderItemList = new ArrayList<>();
 		Optional.ofNullable(ascs)
-			.ifPresent(s -> orderItemList.addAll(
-					Arrays.stream(s).filter(sqlInjectPredicate()).map(OrderItem::asc).toList()));
+			.ifPresent(s -> orderItemList
+				.addAll(Arrays.stream(s).filter(sqlInjectPredicate()).map(OrderItem::asc).toList()));
 		Optional.ofNullable(descs)
-			.ifPresent(s -> orderItemList.addAll(
-					Arrays.stream(s).filter(sqlInjectPredicate()).map(OrderItem::desc).toList()));
+			.ifPresent(s -> orderItemList
+				.addAll(Arrays.stream(s).filter(sqlInjectPredicate()).map(OrderItem::desc).toList()));
 		page.addOrder(orderItemList);
 
 		return page;

+ 1 - 2
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/annotation/EnableAuthResourceServer.java

@@ -7,7 +7,6 @@ import org.springframework.context.annotation.Import;
 
 import java.lang.annotation.*;
 
-
 /**
  * <p>
  * oauth2登录注解
@@ -19,7 +18,7 @@ import java.lang.annotation.*;
 @Inherited
 @Target({ ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
-@Import({ SkyResourceServerAutoConfiguration.class, AuthResourceServerConfiguration.class})
+@Import({ SkyResourceServerAutoConfiguration.class, AuthResourceServerConfiguration.class })
 public @interface EnableAuthResourceServer {
 
 }

+ 0 - 1
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/annotation/EnableLoginResourceServer.java

@@ -6,7 +6,6 @@ import org.springframework.context.annotation.Import;
 
 import java.lang.annotation.*;
 
-
 /**
  * <p>
  * oauth2登录注解

+ 1 - 2
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/annotation/Inner.java

@@ -2,9 +2,8 @@ package com.kxs.common.security.annotation;
 
 import java.lang.annotation.*;
 
-
 /**
- *  url请求不鉴权注解
+ * url请求不鉴权注解
  *
  * @author 没秃顶的码农
  * @date 2023/10/28

+ 13 - 13
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/AuthResourceServerConfiguration.java

@@ -40,21 +40,21 @@ public class AuthResourceServerConfiguration {
 	SecurityFilterChain securityFilterChainAuth(HttpSecurity http) throws Exception {
 
 		AntPathRequestMatcher[] requestMatchers = permitAllUrl.getUrls()
-				.stream()
-				.map(AntPathRequestMatcher::new)
-				.toList()
-				.toArray(new AntPathRequestMatcher[] {});
+			.stream()
+			.map(AntPathRequestMatcher::new)
+			.toList()
+			.toArray(new AntPathRequestMatcher[] {});
 
 		http.authorizeHttpRequests(authorizeRequests -> authorizeRequests.requestMatchers(requestMatchers)
-						.permitAll()
-						.anyRequest()
-						.authenticated())
-				.oauth2ResourceServer(
-						oauth2 -> oauth2.opaqueToken(token -> token.introspector(customOpaqueTokenIntrospector))
-								.authenticationEntryPoint(resourceAuthExceptionEntryPoint)
-								.bearerTokenResolver(skyBearerTokenExtractor))
-				.headers(headers -> headers.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable))
-				.csrf(AbstractHttpConfigurer::disable);
+			.permitAll()
+			.anyRequest()
+			.authenticated())
+			.oauth2ResourceServer(
+					oauth2 -> oauth2.opaqueToken(token -> token.introspector(customOpaqueTokenIntrospector))
+						.authenticationEntryPoint(resourceAuthExceptionEntryPoint)
+						.bearerTokenResolver(skyBearerTokenExtractor))
+			.headers(headers -> headers.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable))
+			.csrf(AbstractHttpConfigurer::disable);
 
 		return http.build();
 	}

+ 0 - 1
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/PermissionService.java

@@ -10,7 +10,6 @@ import org.springframework.util.StringUtils;
 
 import java.util.Collection;
 
-
 /**
  * 接口权限判断工具
  *

+ 2 - 2
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/PermitAllUrlProperties.java

@@ -16,7 +16,6 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
 import java.util.*;
 import java.util.regex.Pattern;
 
-
 /**
  * <p>
  * 资源服务器对外直接暴露URL,如果设置contex-path 要特殊处理
@@ -30,7 +29,8 @@ public class PermitAllUrlProperties implements InitializingBean {
 
 	private static final Pattern PATTERN = Pattern.compile("\\{(.*?)\\}");
 
-	private static final String[] DEFAULT_IGNORE_URLS = new String[] { "/actuator/**", "/oauth2/**", "/code", "/error", "/v3/api-docs" };
+	private static final String[] DEFAULT_IGNORE_URLS = new String[] { "/actuator/**", "/oauth2/**", "/code", "/error",
+			"/v3/api-docs" };
 
 	@Getter
 	@Setter

+ 0 - 1
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/ResourceAuthExceptionEntryPoint.java

@@ -16,7 +16,6 @@ import org.springframework.security.web.AuthenticationEntryPoint;
 
 import java.io.PrintWriter;
 
-
 /**
  * 客户端异常处理 AuthenticationException 不同细化异常处理
  *

+ 0 - 2
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyBearerTokenExtractor.java

@@ -14,9 +14,7 @@ import org.springframework.util.StringUtils;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-
 /**
- *
  * @author 没秃顶的码农
  * @date 2023/10/28
  */

+ 2 - 2
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyCustomOAuth2AccessTokenResponseHttpMessageConverter.java

@@ -34,8 +34,8 @@ public class SkyCustomOAuth2AccessTokenResponseHttpMessageConverter
 	protected void writeInternal(OAuth2AccessTokenResponse tokenResponse, HttpOutputMessage outputMessage)
 			throws HttpMessageNotWritableException {
 		try {
-			R<Map<String, Object>> tokenResponseParameters = R.ok(this.accessTokenResponseParametersConverter
-				.convert(tokenResponse));
+			R<Map<String, Object>> tokenResponseParameters = R
+				.ok(this.accessTokenResponseParametersConverter.convert(tokenResponse));
 
 			ObjectMapper objectMapper = SpringContextHolder.getBean(ObjectMapper.class);
 			GenericHttpMessageConverter<Object> jsonMessageConverter = new MappingJackson2HttpMessageConverter(

+ 1 - 1
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyCustomOpaqueTokenIntrospector.java

@@ -57,7 +57,7 @@ public class SkyCustomOpaqueTokenIntrospector implements OpaqueTokenIntrospector
 
 		try {
 
-			//获取用户信息
+			// 获取用户信息
 			Object principal = Objects.requireNonNull(oldAuthorization).getAttributes().get(Principal.class.getName());
 			Authentication authentication = (Authentication) principal;
 

+ 0 - 1
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyResourceServerAutoConfiguration.java

@@ -3,7 +3,6 @@ package com.kxs.common.security.component;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import lombok.RequiredArgsConstructor;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
 import org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospector;

+ 19 - 19
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/component/SkyResourceServerConfiguration.java

@@ -54,30 +54,30 @@ public class SkyResourceServerConfiguration {
 	@Bean
 	@Order(1)
 	SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
-		//过滤器链
+		// 过滤器链
 		http.securityMatcher(SecurityConstants.OAUTH_TOKEN_URL);
 
 		OAuth2AuthorizationServerConfigurer authorizationServerConfigurer = new OAuth2AuthorizationServerConfigurer();
 
 		http.apply(authorizationServerConfigurer.tokenEndpoint((tokenEndpoint) -> {// 个性化认证授权端点
-					tokenEndpoint.accessTokenRequestConverter(accessTokenRequestConverter()) // 注入自定义的授权认证Converter
-							.accessTokenResponseHandler(new SkyAuthenticationSuccessEventHandler()) // 登录成功处理器
-							.errorResponseHandler(new SkyAuthenticationFailureEventHandler());// 登录失败处理器
-				}).clientAuthentication(oAuth2ClientAuthenticationConfigurer -> // 个性化客户端认证
-						oAuth2ClientAuthenticationConfigurer.errorResponseHandler(new SkyAuthenticationFailureEventHandler()))// 处理客户端认证异常
-				.authorizationEndpoint(authorizationEndpoint -> authorizationEndpoint// 授权码端点个性化confirm页面
-						.consentPage(SecurityConstants.CUSTOM_CONSENT_PAGE_URI)));
+			tokenEndpoint.accessTokenRequestConverter(accessTokenRequestConverter()) // 注入自定义的授权认证Converter
+				.accessTokenResponseHandler(new SkyAuthenticationSuccessEventHandler()) // 登录成功处理器
+				.errorResponseHandler(new SkyAuthenticationFailureEventHandler());// 登录失败处理器
+		}).clientAuthentication(oAuth2ClientAuthenticationConfigurer -> // 个性化客户端认证
+		oAuth2ClientAuthenticationConfigurer.errorResponseHandler(new SkyAuthenticationFailureEventHandler()))// 处理客户端认证异常
+			.authorizationEndpoint(authorizationEndpoint -> authorizationEndpoint// 授权码端点个性化confirm页面
+				.consentPage(SecurityConstants.CUSTOM_CONSENT_PAGE_URI)));
 
 		AntPathRequestMatcher[] requestMatchers = new AntPathRequestMatcher[] {};
 
 		http.authorizeHttpRequests(authorizeRequests -> {
-					// 自定义接口、端点暴露
-					authorizeRequests.requestMatchers(requestMatchers).permitAll();
-					authorizeRequests.anyRequest().authenticated();
-				})
-				.apply(authorizationServerConfigurer.authorizationService(authorizationService)// redis存储token的实现
-						.authorizationServerSettings(
-								AuthorizationServerSettings.builder().issuer(SecurityConstants.PROJECT_LICENSE).build()));
+			// 自定义接口、端点暴露
+			authorizeRequests.requestMatchers(requestMatchers).permitAll();
+			authorizeRequests.anyRequest().authenticated();
+		})
+			.apply(authorizationServerConfigurer.authorizationService(authorizationService)// redis存储token的实现
+				.authorizationServerSettings(
+						AuthorizationServerSettings.builder().issuer(SecurityConstants.PROJECT_LICENSE).build()));
 		http.apply(new FormIdentityLoginConfigurer());
 		DefaultSecurityFilterChain securityFilterChain = http.build();
 
@@ -98,10 +98,10 @@ public class SkyResourceServerConfiguration {
 	@Order(0)
 	SecurityFilterChain resources(HttpSecurity http) throws Exception {
 		http.securityMatchers((matchers) -> matchers.requestMatchers("/actuator/**", "/css/**", "/error"))
-				.authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll())
-				.requestCache(RequestCacheConfigurer::disable)
-				.securityContext(AbstractHttpConfigurer::disable)
-				.sessionManagement(AbstractHttpConfigurer::disable);
+			.authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll())
+			.requestCache(RequestCacheConfigurer::disable)
+			.securityContext(AbstractHttpConfigurer::disable)
+			.sessionManagement(AbstractHttpConfigurer::disable);
 		return http.build();
 	}
 

+ 2 - 3
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/model/KxsUser.java

@@ -13,7 +13,6 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
-
 /**
  * kxs用户
  *
@@ -43,8 +42,8 @@ public class KxsUser extends User implements OAuth2AuthenticatedPrincipal {
 	@Getter
 	private final String phone;
 
-	public KxsUser(Long id, String username, String password, String phone, boolean enabled,
-			boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked,
+	public KxsUser(Long id, String username, String password, String phone, boolean enabled, boolean accountNonExpired,
+			boolean credentialsNonExpired, boolean accountNonLocked,
 			Collection<? extends GrantedAuthority> authorities) {
 		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
 		this.id = id;

+ 6 - 7
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/service/KxsRemoteRegisteredClientRepository.java

@@ -78,7 +78,6 @@ public class KxsRemoteRegisteredClientRepository implements RegisteredClientRepo
 
 	/**
 	 * 重写原生方法支持redis缓存
-	 *
 	 * @param clientId 客戶端
 	 * @return 注册客户
 	 */
@@ -88,10 +87,10 @@ public class KxsRemoteRegisteredClientRepository implements RegisteredClientRepo
 	public RegisteredClient findByClientId(String clientId) {
 
 		SysOauthClientDetails clientDetails = RetOps
-				.of(clientDetailsService.getClientDetailsById(clientId, SecurityConstants.FROM_IN))
-				.getData()
-				.orElseThrow(() -> new OAuth2AuthorizationCodeRequestAuthenticationException(
-						new OAuth2Error("客户端查询异常,请检查数据库链接"), null));
+			.of(clientDetailsService.getClientDetailsById(clientId, SecurityConstants.FROM_IN))
+			.getData()
+			.orElseThrow(() -> new OAuth2AuthorizationCodeRequestAuthenticationException(
+					new OAuth2Error("客户端查询异常,请检查数据库链接"), null));
 
 		RegisteredClient.Builder builder = RegisteredClient.withId(clientDetails.getClientId())
 			.clientId(clientDetails.getClientId())
@@ -117,8 +116,8 @@ public class KxsRemoteRegisteredClientRepository implements RegisteredClientRepo
 		return builder
 			.tokenSettings(TokenSettings.builder()
 				.accessTokenFormat(OAuth2TokenFormat.REFERENCE)
-				.accessTokenTimeToLive(Duration.ofSeconds(
-						Optional.ofNullable(clientDetails.getAccessTokenValidity()).orElse(ACCESS_TOKEN_VALIDITY_SECONDS)))
+				.accessTokenTimeToLive(Duration.ofSeconds(Optional.ofNullable(clientDetails.getAccessTokenValidity())
+					.orElse(ACCESS_TOKEN_VALIDITY_SECONDS)))
 				.refreshTokenTimeToLive(Duration.ofSeconds(Optional.ofNullable(clientDetails.getRefreshTokenValidity())
 					.orElse(REFRESH_TOKEN_VALIDITY_SECONDS)))
 				.build())

+ 0 - 2
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/service/KxsUserDetailsService.java

@@ -29,10 +29,8 @@ public interface KxsUserDetailsService extends UserDetailsService, Ordered {
 		return 0;
 	}
 
-
 	/**
 	 * 通过用户实体查询
-	 *
 	 * @param kxsUser user
 	 * @return 用户详细信息
 	 */

+ 8 - 9
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/service/KxsUserDetailsServiceImpl.java

@@ -46,7 +46,6 @@ public class KxsUserDetailsServiceImpl implements KxsUserDetailsService {
 
 	/**
 	 * 用户名密码登录
-	 *
 	 * @param username 用户名
 	 * @return 用户详细信息
 	 */
@@ -62,8 +61,9 @@ public class KxsUserDetailsServiceImpl implements KxsUserDetailsService {
 		userDTO.setUsername(username);
 		R<UserInfo> result = remoteUserService.info(userDTO, SecurityConstants.FROM_IN);
 
-		UserInfo info = RetOps.of(result).getData().orElseThrow(() ->
-				new UsernameNotFoundException(ErrorTypeEnum.USER_NOT_FOUND.getDescription()));
+		UserInfo info = RetOps.of(result)
+			.getData()
+			.orElseThrow(() -> new UsernameNotFoundException(ErrorTypeEnum.USER_NOT_FOUND.getDescription()));
 		UserDetails userDetails = getUserDetails(info);
 
 		if (cache != null) {
@@ -79,12 +79,11 @@ public class KxsUserDetailsServiceImpl implements KxsUserDetailsService {
 
 	/**
 	 * 获取用户详细信息
-	 *
 	 * @param info 用户信息
 	 * @return UserDetails
 	 */
 	private UserDetails getUserDetails(UserInfo info) {
-		if(info == null){
+		if (info == null) {
 			throw new UsernameNotFoundException("用户不存在");
 		}
 
@@ -99,13 +98,13 @@ public class KxsUserDetailsServiceImpl implements KxsUserDetailsService {
 		}
 
 		Collection<GrantedAuthority> authorities = AuthorityUtils
-				.createAuthorityList(dbAuthsSet.toArray(new String[0]));
+			.createAuthorityList(dbAuthsSet.toArray(new String[0]));
 		SysUser user = info.getSysUser();
 
 		// 构造security用户
-		return new KxsUser(user.getUserId(), user.getUsername(),
-				SecurityConstants.BCRYPT + user.getPassword(), user.getPhone(), true, true, true,
-				StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL), authorities);
+		return new KxsUser(user.getUserId(), user.getUsername(), SecurityConstants.BCRYPT + user.getPassword(),
+				user.getPhone(), true, true, true, StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL),
+				authorities);
 	}
 
 }

+ 3 - 3
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/CustomeOAuth2AccessTokenGenerator.java

@@ -82,9 +82,9 @@ public class CustomeOAuth2AccessTokenGenerator implements OAuth2TokenGenerator<O
 		}
 
 		OAuth2TokenClaimsSet accessTokenClaimsSet = claimsBuilder.build();
-		return new OAuth2AccessTokenClaims(OAuth2AccessToken.TokenType.BEARER,
-				UUID.randomUUID().toString(), accessTokenClaimsSet.getIssuedAt(), accessTokenClaimsSet.getExpiresAt(),
-				context.getAuthorizedScopes(), accessTokenClaimsSet.getClaims());
+		return new OAuth2AccessTokenClaims(OAuth2AccessToken.TokenType.BEARER, UUID.randomUUID().toString(),
+				accessTokenClaimsSet.getIssuedAt(), accessTokenClaimsSet.getExpiresAt(), context.getAuthorizedScopes(),
+				accessTokenClaimsSet.getClaims());
 	}
 
 	/**

+ 11 - 12
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java

@@ -234,32 +234,31 @@ public abstract class OAuth2ResourceOwnerBaseAuthenticationProvider<T extends OA
 			AuthenticationException authenticationException) {
 		if (authenticationException instanceof UsernameNotFoundException) {
 			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USERNAME_NOT_FOUND,
-					ErrorTypeEnum.USER_NOT_FOUND.getDescription(),
-					""));
+					ErrorTypeEnum.USER_NOT_FOUND.getDescription(), ""));
 		}
 		if (authenticationException instanceof BadCredentialsException) {
-			return new OAuth2AuthenticationException(
-					new OAuth2Error(OAuth2ErrorCodesExpand.BAD_CREDENTIALS, ErrorTypeEnum.BAD_CREDENTIALS.getDescription(), ""));
+			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.BAD_CREDENTIALS,
+					ErrorTypeEnum.BAD_CREDENTIALS.getDescription(), ""));
 		}
 		if (authenticationException instanceof LockedException) {
-			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USER_LOCKED, ErrorTypeEnum.ACCOUNT_LOCKED.getDescription(), ""));
+			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USER_LOCKED,
+					ErrorTypeEnum.ACCOUNT_LOCKED.getDescription(), ""));
 		}
 		if (authenticationException instanceof DisabledException) {
 			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USER_DISABLE,
-					ErrorTypeEnum.USER_DISABLED.getDescription(),
-					""));
+					ErrorTypeEnum.USER_DISABLED.getDescription(), ""));
 		}
 		if (authenticationException instanceof AccountExpiredException) {
-			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USER_EXPIRED, ErrorTypeEnum.ACCESS_DENIED.getDescription(), ""));
+			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.USER_EXPIRED,
+					ErrorTypeEnum.ACCESS_DENIED.getDescription(), ""));
 		}
 		if (authenticationException instanceof CredentialsExpiredException) {
 			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodesExpand.CREDENTIALS_EXPIRED,
-					ErrorTypeEnum.CREDENTIALS_EXPIRED.getDescription(),
-					""));
+					ErrorTypeEnum.CREDENTIALS_EXPIRED.getDescription(), ""));
 		}
 		if (authenticationException instanceof ScopeException) {
-			return new OAuth2AuthenticationException(new OAuth2Error(OAuth2ErrorCodes.INVALID_SCOPE,
-					ErrorTypeEnum.ACCESS_DENIED.getDescription(), ""));
+			return new OAuth2AuthenticationException(
+					new OAuth2Error(OAuth2ErrorCodes.INVALID_SCOPE, ErrorTypeEnum.ACCESS_DENIED.getDescription(), ""));
 		}
 		return new OAuth2AuthenticationException(OAuth2ErrorCodesExpand.UN_KNOW_LOGIN_ERROR);
 	}

+ 2 - 3
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/core/SkyDaoAuthenticationProvider.java

@@ -65,9 +65,8 @@ public class SkyDaoAuthenticationProvider extends AbstractUserDetailsAuthenticat
 
 	/**
 	 * <p>
-	 *     校验用户信息,校验密码,状态等
-	 *
-	 * @param userDetails    用户详细信息
+	 * 校验用户信息,校验密码,状态等
+	 * @param userDetails 用户详细信息
 	 * @param authentication 身份验证
 	 * @throws AuthenticationException 身份验证异常
 	 */

+ 3 - 2
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/handler/FormAuthenticationFailureHandler.java

@@ -28,8 +28,9 @@ public class FormAuthenticationFailureHandler implements AuthenticationFailureHa
 	public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
 			AuthenticationException exception) {
 		log.debug("表单登录失败:{}", exception.getLocalizedMessage());
-//		String url = HttpUtil.encodeParams(String.format("/token/login?error=%s", exception.getMessage()),
-//				CharsetUtil.CHARSET_UTF_8);
+		// String url = HttpUtil.encodeParams(String.format("/token/login?error=%s",
+		// exception.getMessage()),
+		// CharsetUtil.CHARSET_UTF_8);
 		WebUtils.getResponse().sendRedirect("url");
 	}
 

+ 2 - 1
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/support/handler/SkyAuthenticationSuccessEventHandler.java

@@ -72,7 +72,8 @@ public class SkyAuthenticationSuccessEventHandler implements AuthenticationSucce
 		sendAccessTokenResponse(response, authentication);
 	}
 
-	private void sendAccessTokenResponse(HttpServletResponse response, Authentication authentication) throws IOException {
+	private void sendAccessTokenResponse(HttpServletResponse response, Authentication authentication)
+			throws IOException {
 
 		OAuth2AccessTokenAuthenticationToken accessTokenAuthentication = (OAuth2AccessTokenAuthenticationToken) authentication;
 

+ 3 - 5
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/util/OAuth2EndpointUtils.java

@@ -15,7 +15,6 @@ import java.io.IOException;
 import java.time.temporal.ChronoUnit;
 import java.util.Map;
 
-
 /**
  * OAuth2 端点工具
  *
@@ -53,14 +52,14 @@ public class OAuth2EndpointUtils {
 	 * @throws IOException
 	 */
 	public OAuth2AccessTokenResponse sendAccessTokenResponse(OAuth2Authorization authentication,
-															 Map<String, Object> claims) {
+			Map<String, Object> claims) {
 
 		OAuth2AccessToken accessToken = authentication.getAccessToken().getToken();
 		OAuth2RefreshToken refreshToken = authentication.getRefreshToken().getToken();
 
 		OAuth2AccessTokenResponse.Builder builder = OAuth2AccessTokenResponse.withToken(accessToken.getTokenValue())
-				.tokenType(accessToken.getTokenType())
-				.scopes(accessToken.getScopes());
+			.tokenType(accessToken.getTokenType())
+			.scopes(accessToken.getScopes());
 		if (accessToken.getIssuedAt() != null && accessToken.getExpiresAt() != null) {
 			builder.expiresIn(ChronoUnit.SECONDS.between(accessToken.getIssuedAt(), accessToken.getExpiresAt()));
 		}
@@ -74,5 +73,4 @@ public class OAuth2EndpointUtils {
 		return builder.build();
 	}
 
-
 }

+ 0 - 1
kxs-common/kxs-common-security/src/main/java/com/kxs/common/security/util/SecurityUtils.java

@@ -12,7 +12,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-
 /**
  * 安全工具類
  *

+ 15 - 18
kxs-gateway/src/main/java/com/kxs/gateway/api/config/AesCryptoConfig.java

@@ -15,24 +15,21 @@ import org.springframework.context.annotation.Configuration;
 @RequiredArgsConstructor
 public class AesCryptoConfig {
 
-    private final GatewayConfigProperties configProperties;
+	private final GatewayConfigProperties configProperties;
 
+	/**
+	 * <p>
+	 * aes加密配置 此处设在配置类可以避免每次请求都去创建加密类,以此节约性能
+	 * </p>
+	 * @return {@link AES}
+	 */
+	@Bean
+	public AES cryptoAes() {
+		return new AES(configProperties.getEncodeMode(), configProperties.getEncodePadding(),
+				// 密钥,可以自定义
+				configProperties.getEncodeKey().getBytes(),
+				// iv加盐,按照实际需求添加
+				configProperties.getEncodeIv().getBytes());
+	}
 
-
-    /**
-     * <p>
-     *     aes加密配置
-     *     此处设在配置类可以避免每次请求都去创建加密类,以此节约性能
-     * </p>
-     *
-     * @return {@link AES}
-     */
-    @Bean
-    public AES cryptoAes(){
-        return new AES(configProperties.getEncodeMode(), configProperties.getEncodePadding(),
-                // 密钥,可以自定义
-                configProperties.getEncodeKey().getBytes(),
-                // iv加盐,按照实际需求添加
-                configProperties.getEncodeIv().getBytes());
-    }
 }

+ 2 - 3
kxs-gateway/src/main/java/com/kxs/gateway/api/config/GatewayConfiguration.java

@@ -12,7 +12,6 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.data.redis.core.RedisTemplate;
 
-
 /**
  * 网关配置
  *
@@ -35,7 +34,7 @@ public class GatewayConfiguration {
 
 	@Bean
 	public ValidateCodeGatewayFilter validateCodeGatewayFilter(GatewayConfigProperties configProperties,
-															   ObjectMapper objectMapper, RedisTemplate<String, Object> redisTemplate) {
+			ObjectMapper objectMapper, RedisTemplate<String, Object> redisTemplate) {
 		return new ValidateCodeGatewayFilter(configProperties, objectMapper, redisTemplate);
 	}
 
@@ -45,7 +44,7 @@ public class GatewayConfiguration {
 	}
 
 	@Bean
-	public ImageCodeHandler imageCodeHandler(RedisTemplate<String, Object>  redisTemplate) {
+	public ImageCodeHandler imageCodeHandler(RedisTemplate<String, Object> redisTemplate) {
 		return new ImageCodeHandler(redisTemplate);
 	}
 

+ 2 - 1
kxs-gateway/src/main/java/com/kxs/gateway/api/config/RateLimiterConfiguration.java

@@ -19,7 +19,8 @@ public class RateLimiterConfiguration {
 	/**
 	 * Remote addr key resolver key resolver.
 	 *
-	 * @link {<a href="https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#the-requestratelimiter-gatewayfilter-factory">...</a>}
+	 * @link {<a href=
+	 * "https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#the-requestratelimiter-gatewayfilter-factory">...</a>}
 	 */
 	@Bean
 	public KeyResolver remoteAddrKeyResolver() {

+ 4 - 5
kxs-gateway/src/main/java/com/kxs/gateway/api/config/RouterFunctionConfiguration.java

@@ -11,10 +11,8 @@ import org.springframework.web.reactive.function.server.RouterFunction;
 import org.springframework.web.reactive.function.server.RouterFunctions;
 import org.springframework.web.reactive.function.server.ServerResponse;
 
-
 /**
- * 验证码路由器
- * webflux响应式编程
+ * 验证码路由器 webflux响应式编程
  *
  * @author 没秃顶的码农
  * @date 2023/11/04
@@ -24,12 +22,13 @@ import org.springframework.web.reactive.function.server.ServerResponse;
 @RequiredArgsConstructor
 public class RouterFunctionConfiguration {
 
-
 	private final ImageCodeHandler imageCodeHandler;
 
 	@Bean
 	public RouterFunction<ServerResponse> routerFunction() {
 		return RouterFunctions.route(
-				RequestPredicates.path("/v1/kxs/code").and(RequestPredicates.accept(MediaType.TEXT_PLAIN)), imageCodeHandler);
+				RequestPredicates.path("/v1/kxs/code").and(RequestPredicates.accept(MediaType.TEXT_PLAIN)),
+				imageCodeHandler);
 	}
+
 }

+ 21 - 17
kxs-gateway/src/main/java/com/kxs/gateway/api/filter/RequestDecoderFilter.java

@@ -43,14 +43,15 @@ public class RequestDecoderFilter extends AbstractGatewayFilterFactory<Object> {
 	public GatewayFilter apply(Object config) {
 		return (exchange, chain) -> {
 			ServerHttpRequest request = exchange.getRequest();
-			//请求方法
+			// 请求方法
 			HttpMethod method = request.getMethod();
 
 			if (method == HttpMethod.GET) {
-				//1 修改请求参数,并获取请求参数
+				// 1 修改请求参数,并获取请求参数
 				try {
 					updateRequestParam(exchange);
-				} catch (Exception e) {
+				}
+				catch (Exception e) {
 					throw new CheckedException("解密异常");
 				}
 			}
@@ -58,29 +59,32 @@ public class RequestDecoderFilter extends AbstractGatewayFilterFactory<Object> {
 			if (method != HttpMethod.POST) {
 				return chain.filter(exchange);
 			}
-			//2 获取请求体,修改请求体
-			ServerRequest serverRequest = ServerRequest.create(exchange, HandlerStrategies.withDefaults().messageReaders());
+			// 2 获取请求体,修改请求体
+			ServerRequest serverRequest = ServerRequest.create(exchange,
+					HandlerStrategies.withDefaults().messageReaders());
 
 			Mono<String> modifiedBody = serverRequest.bodyToMono(String.class).flatMap(body -> {
-				//解密请求体
+				// 解密请求体
 				try {
 					log.info("Post请求:{},待解密请求参数:{}", request.getURI().getPath(), body);
 					String encrypt = cryptoAes.decryptStr(body);
 
 					return Mono.just(encrypt);
 
-				} catch (Exception e) {
+				}
+				catch (Exception e) {
 					log.error(ErrorTypeEnum.DECRYPT_ERROR.getDescription(), e);
 					return Mono.error(new AesDecodeException(ErrorTypeEnum.DECRYPT_ERROR.getDescription()));
 				}
 			});
 
-			//3 创建BodyInserter修改请求体
-			BodyInserter<Mono<String>, ReactiveHttpOutputMessage> bodyInserter = BodyInserters.fromPublisher(modifiedBody, String.class);
+			// 3 创建BodyInserter修改请求体
+			BodyInserter<Mono<String>, ReactiveHttpOutputMessage> bodyInserter = BodyInserters
+				.fromPublisher(modifiedBody, String.class);
 			HttpHeaders headers = new HttpHeaders();
 			headers.putAll(exchange.getRequest().getHeaders());
 			headers.remove(HttpHeaders.CONTENT_LENGTH);
-			//4 创建CachedBodyOutputMessage并且把请求param加入
+			// 4 创建CachedBodyOutputMessage并且把请求param加入
 			CachedBodyOutputMessage outputMessage = new CachedBodyOutputMessage(exchange, headers);
 			return bodyInserter.insert(outputMessage, new BodyInserterContext()).then(Mono.defer(() -> {
 				ServerHttpRequestDecorator decorator = new ServerHttpRequestDecorator(exchange.getRequest()) {
@@ -99,21 +103,21 @@ public class RequestDecoderFilter extends AbstractGatewayFilterFactory<Object> {
 	 */
 	private void updateRequestParam(ServerWebExchange exchange) throws NoSuchFieldException, IllegalAccessException {
 		ServerHttpRequest request = exchange.getRequest();
-		//请求链接
+		// 请求链接
 		URI uri = request.getURI();
-		//请求参数
+		// 请求参数
 		String value = request.getQueryParams().getFirst("value");
 		log.info("Get请求:{},待解密请求参数:{}", uri.getPath(), value);
-		//判断是否有加密的参数 这里的约定是 param
+		// 判断是否有加密的参数 这里的约定是 param
 		if (CharSequenceUtil.isNotBlank(value)) {
-			//解密请求参数
+			// 解密请求参数
 			String decryPtoData = cryptoAes.decryptStr(value);
 			log.info("Get请求:{},解密之后参数:{}", uri.getPath(), decryPtoData);
-			//使用反射强行拿出 URI 的 query
+			// 使用反射强行拿出 URI 的 query
 			Field targetQuery = uri.getClass().getDeclaredField("value");
-			//授权
+			// 授权
 			targetQuery.setAccessible(true);
-			//重新设置参数
+			// 重新设置参数
 			targetQuery.set(uri, decryPtoData);
 		}
 	}

+ 2 - 2
kxs-gateway/src/main/java/com/kxs/gateway/api/filter/ValidateCodeGatewayFilter.java

@@ -26,7 +26,6 @@ import reactor.core.publisher.Mono;
 
 import java.util.Objects;
 
-
 /**
  * 验证码网关过滤器
  *
@@ -95,7 +94,8 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory<Obje
 	 * @return 是否为刷新令牌请求
 	 */
 	private boolean isRefreshTokenRequest(ServerHttpRequest request) {
-		return CharSequenceUtil.equals(SecurityConstants.REFRESH_TOKEN, request.getQueryParams().getFirst("grant_type"));
+		return CharSequenceUtil.equals(SecurityConstants.REFRESH_TOKEN,
+				request.getQueryParams().getFirst("grant_type"));
 	}
 
 	/**

+ 5 - 5
kxs-gateway/src/main/java/com/kxs/gateway/api/handler/ImageCodeHandler.java

@@ -22,7 +22,6 @@ import reactor.core.publisher.Mono;
 import java.util.Optional;
 import java.util.concurrent.TimeUnit;
 
-
 /**
  * 验证码生成逻辑处理类
  *
@@ -45,21 +44,22 @@ public class ImageCodeHandler implements HandlerFunction<ServerResponse> {
 		// 保存验证码信息
 		Optional<String> randomStr = serverRequest.queryParam("randomStr");
 
-		//生成验证码
+		// 生成验证码
 		RandomGenerator randomGenerator = new RandomGenerator("0123456789", 4);
 		LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT);
 		lineCaptcha.setGenerator(randomGenerator);
 
 		redisTemplate.setKeySerializer(new StringRedisSerializer());
 		randomStr.ifPresent(s -> redisTemplate.opsForValue()
-				.set(CacheConstants.DEFAULT_CODE_KEY + s, lineCaptcha.getCode(), SecurityConstants.CODE_TIME, TimeUnit.SECONDS));
+			.set(CacheConstants.DEFAULT_CODE_KEY + s, lineCaptcha.getCode(), SecurityConstants.CODE_TIME,
+					TimeUnit.SECONDS));
 
 		// 转换流信息写出
 		FastByteArrayOutputStream os = new FastByteArrayOutputStream();
 		lineCaptcha.write(os);
 		return ServerResponse.status(HttpStatus.OK)
-				.contentType(MediaType.IMAGE_JPEG)
-				.body(BodyInserters.fromResource(new ByteArrayResource(os.toByteArray())));
+			.contentType(MediaType.IMAGE_JPEG)
+			.body(BodyInserters.fromResource(new ByteArrayResource(os.toByteArray())));
 
 	}
 

+ 13 - 0
kxs-gateway/src/main/resources/application-dev.yml

@@ -0,0 +1,13 @@
+spring:
+  cloud:
+    discovery:
+      client:
+        simple:
+          instances:
+            kxs-system-biz: #负载均衡
+              - uri: http://127.0.0.1:8080
+            kxs-codegen:
+              - uri: http://127.0.0.1:5002
+            kxs-quartz:
+              - uri: http://127.0.0.1:5007
+

+ 13 - 0
kxs-gateway/src/main/resources/application-prod.yml

@@ -0,0 +1,13 @@
+
+spring:
+  cloud:
+    discovery:
+      client:
+        simple:
+          instances:
+            kxs-system-biz: #负载均衡
+              - uri: http://127.0.0.1:8080
+            kxs-codegen:
+              - uri: http://127.0.0.1:5002
+            kxs-quartz:
+              - uri: http://127.0.0.1:5007

+ 13 - 0
kxs-gateway/src/main/resources/application-test.yml

@@ -0,0 +1,13 @@
+
+spring:
+  cloud:
+    discovery:
+      client:
+        simple:
+          instances:
+            kxs-system-biz: #负载均衡
+              - uri: http://127.0.0.1:8080
+            kxs-codegen:
+              - uri: http://127.0.0.1:5002
+            kxs-quartz:
+              - uri: http://127.0.0.1:5007

+ 5 - 13
kxs-gateway/src/main/resources/application.yml

@@ -2,6 +2,10 @@
 server:
   port: 9999
 spring:
+  profiles:
+    active: @profiles.active@
+  application:
+    name: kxs-gateway
   cloud:
     gateway:
       routes:
@@ -50,18 +54,6 @@ spring:
           filters:
             - RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/$\{path}/v3/api-docs
 
-
-    discovery:
-      client:
-        simple:
-          instances:
-            kxs-system-biz: #负载均衡
-              - uri: http://127.0.0.1:8080
-            kxs-codegen:
-              - uri: http://127.0.0.1:5002
-            kxs-quartz:
-              - uri: http://127.0.0.1:5007
-
 gateway:
   aes:
     encode-key: 'CBTU1dD4Kd5pyiGWTsI10jRQ3SvKusSV'
@@ -70,4 +62,4 @@ gateway:
     encode-padding: 'PKCS7Padding'
   #不校验验证码的客户端
   ignore-clients:
-    - sky
+    - kxs

+ 10 - 0
kxs-quartz/src/main/resources/application-dev.yml

@@ -0,0 +1,10 @@
+
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    username: root
+    password: root
+    url: jdbc:mysql://localhost:3306/kxs_job?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+
+

+ 10 - 0
kxs-quartz/src/main/resources/application-prod.yml

@@ -0,0 +1,10 @@
+
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    username: root
+    password: root
+    url: jdbc:mysql://localhost:3306/kxs_job?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+
+

+ 10 - 0
kxs-quartz/src/main/resources/application-test.yml

@@ -0,0 +1,10 @@
+
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    username: root
+    password: root
+    url: jdbc:mysql://localhost:3306/kxs_job?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+
+

+ 2 - 0
kxs-quartz/src/main/resources/application.yml

@@ -2,6 +2,8 @@ server:
   port: 5007
 
 spring:
+  application:
+    name: @artifactId@
   datasource:
     type: com.zaxxer.hikari.HikariDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver

+ 1 - 2
kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/feign/RemoteClientDetailsService.java

@@ -9,7 +9,6 @@ import org.springframework.web.service.annotation.GetExchange;
 
 import java.util.List;
 
-
 /**
  * 远程客户端详细信息服务
  *
@@ -26,7 +25,7 @@ public interface RemoteClientDetailsService {
 	 */
 	@GetExchange("/client/getClientDetailsById/{clientId}")
 	R<SysOauthClientDetails> getClientDetailsById(@PathVariable("clientId") String clientId,
-												  @RequestHeader(SecurityConstants.FROM) String from);
+			@RequestHeader(SecurityConstants.FROM) String from);
 
 	/**
 	 * 查询全部客户端

+ 1 - 3
kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/feign/RemoteLogService.java

@@ -6,7 +6,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.service.annotation.PostExchange;
 
-
 /**
  * 远程日志服务
  *
@@ -17,10 +16,9 @@ public interface RemoteLogService {
 
 	/**
 	 * 保存日志
-	 *
 	 * @param sysLog 日志实体
 	 */
 	@PostExchange("/log/save")
-	void saveLog(@RequestBody SysLog sysLog,  @RequestHeader(SecurityConstants.FROM) String from);
+	void saveLog(@RequestBody SysLog sysLog, @RequestHeader(SecurityConstants.FROM) String from);
 
 }

+ 0 - 1
kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/feign/RemoteUserService.java

@@ -1,5 +1,4 @@
 
-
 package com.kxs.system.api.feign;
 
 import com.kxs.common.core.constant.SecurityConstants;

+ 73 - 78
kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/feign/config/AdminFeignClientConfiguration.java

@@ -22,11 +22,9 @@ import java.util.Optional;
 
 /**
  * <p>
- * 当前服务的webClient配置
- * 服务下的远程调用统一在此配置
+ * 当前服务的webClient配置 服务下的远程调用统一在此配置
  * </p>
  *
- *
  * @author 没秃顶的码农
  * @date 2023/11/13
  */
@@ -34,87 +32,84 @@ import java.util.Optional;
 @RequiredArgsConstructor
 public class AdminFeignClientConfiguration {
 
+	@Bean
+	public WebClient oauthRequestInterceptor() {
 
-    @Bean
-    public WebClient oauthRequestInterceptor() {
+		return WebClient.builder()
+			// 给请求添加过滤器,添加自定义的认证头
+			.filter((request, next) -> {
+				ClientRequest.Builder filtered = ClientRequest.from(request);
 
-        return WebClient.builder()
-                //给请求添加过滤器,添加自定义的认证头
-                .filter((request, next) -> {
-                    ClientRequest.Builder filtered = ClientRequest.from(request);
+				ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder
+					.getRequestAttributes();
+				// 不是web请求不传递token
+				if (requestAttributes != null) {
+					HttpServletRequest httpServletRequest = requestAttributes.getRequest();
+					String token = httpServletRequest.getHeader(HttpHeaders.AUTHORIZATION);
+					if (!StrUtil.isBlank(token)) {
+						// 传递token
+						filtered.header(HttpHeaders.AUTHORIZATION, token);
+					}
+				}
+				return next.exchange(filtered.build());
+			})
+			.baseUrl(ServiceNameConstants.ADMIN_SERVICE)
+			.build();
+	}
 
-                    ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
-                    //不是web请求不传递token
-                    if(requestAttributes != null){
-                        HttpServletRequest httpServletRequest = requestAttributes.getRequest();
-                        String token = httpServletRequest.getHeader(HttpHeaders.AUTHORIZATION);
-                        if (!StrUtil.isBlank(token)) {
-                            //传递token
-                            filtered.header(HttpHeaders.AUTHORIZATION, token);
-                        }
-                    }
-                    return next.exchange(filtered.build());
-                })
-                .baseUrl(ServiceNameConstants.ADMIN_SERVICE).build();
-    }
+	/**
+	 * 远程日志服务
+	 * @param client 客户端
+	 * @return 远程日志服务
+	 */
+	@Bean
+	RemoteLogService remoteLogService(WebClient client) {
+		HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
+		return factory.createClient(RemoteLogService.class);
+	}
 
-    /**
-     * 远程日志服务
-     *
-     * @param client 客户端
-     * @return 远程日志服务
-     */
-    @Bean
-    RemoteLogService remoteLogService(WebClient client) {
-        HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
-        return factory.createClient(RemoteLogService.class);
-    }
+	/**
+	 * 远程客户端
+	 * @param client 客户端
+	 * @return 远程日志服务
+	 */
+	@Bean
+	RemoteClientDetailsService remoteClientDetailsService(WebClient client) {
+		HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
+		return factory.createClient(RemoteClientDetailsService.class);
+	}
 
-    /**
-     * 远程客户端
-     *
-     * @param client 客户端
-     * @return 远程日志服务
-     */
-    @Bean
-    RemoteClientDetailsService remoteClientDetailsService(WebClient client) {
-        HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
-        return factory.createClient(RemoteClientDetailsService.class);
-    }
+	/**
+	 * 用户
+	 * @param client 客户端
+	 * @return 远程用户服务
+	 */
+	@Bean
+	RemoteUserService remoteUserService(WebClient client) {
+		HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
+		return factory.createClient(RemoteUserService.class);
+	}
 
-    /**
-     * 用户
-     *
-     * @param client 客户端
-     * @return 远程用户服务
-     */
-    @Bean
-    RemoteUserService remoteUserService(WebClient client) {
-        HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
-        return factory.createClient(RemoteUserService.class);
-    }
+	/**
+	 * 字典
+	 * @param client 客户端
+	 * @return 字典
+	 */
+	@Bean
+	RemoteDictService remoteDictService(WebClient client) {
+		HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
+		return factory.createClient(RemoteDictService.class);
+	}
 
-    /**
-     * 字典
-     *
-     * @param client 客户端
-     * @return 字典
-     */
-    @Bean
-    RemoteDictService remoteDictService(WebClient client) {
-        HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
-        return factory.createClient(RemoteDictService.class);
-    }
+	/**
+	 * 参数
+	 * @param client 客户端
+	 * @return 参数
+	 */
+	@Bean
+	RemoteParamService remoteParamService(WebClient client) {
+		HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
+		return factory.createClient(RemoteParamService.class);
+	}
 
-    /**
-     * 参数
-     *
-     * @param client 客户端
-     * @return 参数
-     */
-    @Bean
-    RemoteParamService remoteParamService(WebClient client) {
-        HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
-        return factory.createClient(RemoteParamService.class);
-    }
 }

+ 0 - 1
kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/vo/PreLogVO.java

@@ -3,7 +3,6 @@ package com.kxs.system.api.vo;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
-
 /**
  * 前端日志vo
  *

+ 0 - 1
kxs-system/kxs-system-api/src/main/java/com/kxs/system/api/vo/UserVO.java

@@ -10,7 +10,6 @@ import java.io.Serializable;
 import java.time.LocalDateTime;
 import java.util.List;
 
-
 /**
  * 用户vo
  *

+ 1 - 1
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/KxsAdminApplication.java

@@ -12,7 +12,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
  * <p>
  * 用户统一管理系统
  */
-@SpringBootApplication(scanBasePackages = {"com.kxs.common.**", "com.kxs.system.**"})
+@SpringBootApplication(scanBasePackages = { "com.kxs.common.**", "com.kxs.system.**" })
 @EnableLoginResourceServer
 @EnableAuthResourceServer
 public class KxsAdminApplication {

+ 6 - 12
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/constant/enums/ErrorTypeEnum.java

@@ -13,20 +13,14 @@ import lombok.RequiredArgsConstructor;
 @RequiredArgsConstructor
 public enum ErrorTypeEnum {
 
-    USER_EMPTY(-1, "用户信息为空"),
-    CLIENT_NULL(-1, "客户端查询异常,请检查数据库链接"),
+	USER_EMPTY(-1, "用户信息为空"), CLIENT_NULL(-1, "客户端查询异常,请检查数据库链接"),
 
+	SYS_PARAM_DELETE_SYSTEM(-1, "系统内置参数不能删除"), SYS_DICT_DELETE_SYSTEM(-1, "系统内置字典不允许删除"),
+	SYS_MENU_DELETE_EXISTING(-1, "菜单存在下级节点 删除失败"), SYS_USER_USERNAME_EXISTING(-1, "用户名已存在"),
+	SYS_USER_UPDATE_PASSWORD_ERROR(-1, "用户原密码错误"), SYS_DICT_UPDATE_SYSTEM(-1, "系统内置字典不能修改");
 
+	private final int code;
 
-    SYS_PARAM_DELETE_SYSTEM(-1, "系统内置参数不能删除"),
-    SYS_DICT_DELETE_SYSTEM(-1, "系统内置字典不允许删除"),
-    SYS_MENU_DELETE_EXISTING(-1, "菜单存在下级节点 删除失败"),
-    SYS_USER_USERNAME_EXISTING(-1, "用户名已存在"),
-    SYS_USER_UPDATE_PASSWORD_ERROR(-1, "用户原密码错误"),
-    SYS_DICT_UPDATE_SYSTEM(-1, "系统内置字典不能修改");
+	private final String description;
 
-
-    private final int code;
-
-    private final String description;
 }

+ 7 - 6
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/LoginController.java

@@ -22,13 +22,14 @@ import org.springframework.web.bind.annotation.RestController;
 @Tag(description = "login", name = "登录管理")
 public class LoginController {
 
-    private final RedisTemplate<String, Object> redisTemplate;
+	private final RedisTemplate<String, Object> redisTemplate;
 
-    private static final Integer DEFAULT_IMAGE_WIDTH = 100;
+	private static final Integer DEFAULT_IMAGE_WIDTH = 100;
 
-    private static final Integer DEFAULT_IMAGE_HEIGHT = 40;
+	private static final Integer DEFAULT_IMAGE_HEIGHT = 40;
+
+	// public R getCode(@RequestParam String randomStr){
+	//
+	// }
 
-//    public R getCode(@RequestParam String randomStr){
-//
-//    }
 }

+ 0 - 1
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysClientController.java

@@ -23,7 +23,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-
 /**
  * <p>
  * 前端控制器

+ 0 - 1
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysDictController.java

@@ -27,7 +27,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-
 /**
  * <p>
  * 字典表 前端控制器

+ 0 - 1
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysLogController.java

@@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-
 /**
  * <p>
  * 日志表 前端控制器

+ 0 - 1
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysMenuController.java

@@ -17,7 +17,6 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-
 /**
  * sys菜单控制器
  *

+ 0 - 2
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysPostController.java

@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-
 /**
  * 岗位信息表
  *
@@ -124,5 +123,4 @@ public class SysPostController {
 		return R.ok(sysPostService.removeBatchByIds(CollUtil.toList(ids)));
 	}
 
-
 }

+ 0 - 1
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysPublicParamController.java

@@ -21,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-
 /**
  * 公共参数
  *

+ 0 - 2
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysRoleController.java

@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-
 /**
  * sys角色控制器
  *
@@ -132,7 +131,6 @@ public class SysRoleController {
 
 	/**
 	 * 通过角色ID 查询角色列表
-	 *
 	 * @param roleIdList 角色ID
 	 * @return 响应信息主体
 	 */

+ 0 - 3
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/SysUserController.java

@@ -27,7 +27,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-
 /**
  * sys用户控制器
  *
@@ -155,8 +154,6 @@ public class SysUserController {
 		return userService.updateUserInfo(userDto);
 	}
 
-
-
 	/**
 	 * 锁定指定用户
 	 * @param username 用户名

+ 3 - 4
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/controller/TokenController.java

@@ -1,5 +1,4 @@
 
-
 package com.kxs.system.biz.controller;
 
 import cn.hutool.core.date.DatePattern;
@@ -103,9 +102,9 @@ public class TokenController {
 			@RequestParam(OAuth2ParameterNames.STATE) String state) {
 
 		SysOauthClientDetails clientDetails = clientDetailsService.getClientDetailsById(clientId);
-			if(clientDetails == null){
-				throw  new OAuthClientException("clientId 不合法");
-			}
+		if (clientDetails == null) {
+			throw new OAuthClientException("clientId 不合法");
+		}
 
 		Set<String> authorizedScopes = StringUtils.commaDelimitedListToSet(clientDetails.getScope());
 		modelAndView.addObject("clientId", clientId);

+ 0 - 1
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/mapper/SysDeptMapper.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.kxs.system.api.model.SysDept;
 import org.apache.ibatis.annotations.Mapper;
 
-
 /**
  * 部门管理 服务类
  *

+ 0 - 1
kxs-system/kxs-system-biz/src/main/java/com/kxs/system/biz/mapper/SysDictItemMapper.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.kxs.system.api.model.SysDictItem;
 import org.apache.ibatis.annotations.Mapper;
 
-
 /**
  * 字典项
  *

Деякі файли не було показано, через те що забагато файлів було змінено