mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 22:57:17 +08:00 
			
		
		
		
	build: continew-starter 2.13.2 => 2.13.3
1.EncryptHelper 包位置调整 2.Starter加密已支持密码编码器,移除 BCryptEncryptor,使用 FieldEncrypt(Algorithm.PASSWORD_ENCODER) 3.Starter优化:MenuServiceImpl 重写 tree 方法,采用单根节点树 4.Starter修复:移除 DeptResp、MenuResp 内 getId 方法 5.其他 Starter 隐式修复
This commit is contained in:
		
							
								
								
									
										13
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								README.md
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
| <img src="https://img.shields.io/badge/SNAPSHOT-v4.0.0-%23ff3f59.svg" alt="Release" /> | <img src="https://img.shields.io/badge/SNAPSHOT-v4.0.0-%23ff3f59.svg" alt="Release" /> | ||||||
| </a> | </a> | ||||||
| <a href="https://github.com/continew-org/continew-starter" title="ContiNew Starter" target="_blank"> | <a href="https://github.com/continew-org/continew-starter" title="ContiNew Starter" target="_blank"> | ||||||
| <img src="https://img.shields.io/badge/ContiNew Starter-2.13.2-%236CB52D.svg" alt="ContiNew Starter" /> | <img src="https://img.shields.io/badge/ContiNew Starter-2.13.3-%236CB52D.svg" alt="ContiNew Starter" /> | ||||||
| </a> | </a> | ||||||
| <a href="https://spring.io/projects/spring-boot" title="Spring Boot" target="_blank"> | <a href="https://spring.io/projects/spring-boot" title="Spring Boot" target="_blank"> | ||||||
| <img src="https://img.shields.io/badge/Spring Boot-3.3.12-%236CB52D.svg?logo=Spring-Boot" alt="Spring Boot" /> | <img src="https://img.shields.io/badge/Spring Boot-3.3.12-%236CB52D.svg?logo=Spring-Boot" alt="Spring Boot" /> | ||||||
| @@ -44,9 +44,14 @@ | |||||||
|  |  | ||||||
| **AI 编程纪元已经开启,基于 ContiNew 项目开发,让 AI 助手“学习”更优雅的代码规范,“写出”更优质的代码。** | **AI 编程纪元已经开启,基于 ContiNew 项目开发,让 AI 助手“学习”更优雅的代码规范,“写出”更优质的代码。** | ||||||
|  |  | ||||||
| ContiNew Admin(Continue New Admin):持续迭代优化的,前后端分离,多租户中后台管理系统框架。开箱即用,重视每一处代码规范,重视每一种解决方案细节,持续提供舒适的前、后端开发体验。 | ContiNew Admin(Continue New Admin),页面现代美观,且专注设计与代码细节的 **高质量多租户中后台** 管理系统框架。开箱即用,持续迭代优化,持续提供舒适的开发体验。 | ||||||
|  |  | ||||||
|  | 当前采用的技术栈:Spring Boot3(Java17)、Vue3 & Arco Design & TS & Vite、Sa-Token、MyBatis Plus、Redisson、FastExcel、CosId、JetCache、JustAuth、Crane4j、Spring Doc、Hutool 等。 | ||||||
|  |  | ||||||
|  | 我们始终坚信好的产品必然是反复打磨出来的,而在工作中我们受限于客户需求、开发周期等因素,无法深度打磨、重构我们的代码,这也是架构腐烂的根源。所以,我们希望能在业余时间,通过开源社区的力量来打磨出一个好的产品,一个好的实践,一个好的生态。 | ||||||
|  |  | ||||||
|  | 我们的愿景在于,当你将 ContiNew 系列项目应用到工作场景时,不仅仅是得到效率的提高,更可以得到舒适的开发体验,让更多开发者的编程工作多一点“甜”。 | ||||||
|  |  | ||||||
| 当前采用的技术栈:Spring Boot3(Java17)、Vue3 & Arco Design & TS & Vite、Sa-Token、MyBatis Plus、FastExcel、Redisson、JetCache、JustAuth、Crane4j、Hutool、Liquibase 等。 |  | ||||||
|  |  | ||||||
| ## 项目源码 | ## 项目源码 | ||||||
|  |  | ||||||
| @@ -226,7 +231,7 @@ public class DeptController extends BaseController<DeptService, DeptResp, DeptDe | |||||||
| | <a href="https://arco.design/vue/docs/start" target="_blank">Arco Design</a> | 2.57.0       | 字节跳动推出的前端 UI 框架,年轻化的色彩和组件设计。         | | | <a href="https://arco.design/vue/docs/start" target="_blank">Arco Design</a> | 2.57.0       | 字节跳动推出的前端 UI 框架,年轻化的色彩和组件设计。         | | ||||||
| | <a href="https://www.typescriptlang.org/zh/" target="_blank">TypeScript</a> | 5.0.4        | TypeScript 是微软开发的一个开源的编程语言,通过在 JavaScript 的基础上添加静态类型定义构建而成。 | | | <a href="https://www.typescriptlang.org/zh/" target="_blank">TypeScript</a> | 5.0.4        | TypeScript 是微软开发的一个开源的编程语言,通过在 JavaScript 的基础上添加静态类型定义构建而成。 | | ||||||
| | <a href="https://vite.dev/" target="_blank">Vite</a>         | 5.1.5        | 下一代的前端工具链,为开发提供极速响应。                     | | | <a href="https://vite.dev/" target="_blank">Vite</a>         | 5.1.5        | 下一代的前端工具链,为开发提供极速响应。                     | | ||||||
| | [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.13.2       | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 | | | [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.13.3       | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 | | ||||||
| | <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.3.12       | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) | | | <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.3.12       | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) | | ||||||
| | <a href="https://undertow.io/" target="_blank">Undertow</a>  | 2.3.18.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 | | | <a href="https://undertow.io/" target="_blank">Undertow</a>  | 2.3.18.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 | | ||||||
| | <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.44.0       | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。             | | | <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.44.0       | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。             | | ||||||
|   | |||||||
| @@ -1,52 +0,0 @@ | |||||||
| /* |  | ||||||
|  * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. |  | ||||||
|  * |  | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  | ||||||
|  * you may not use this file except in compliance with the License. |  | ||||||
|  * You may obtain a copy of the License at |  | ||||||
|  * |  | ||||||
|  *     http://www.apache.org/licenses/LICENSE-2.0 |  | ||||||
|  * |  | ||||||
|  * Unless required by applicable law or agreed to in writing, software |  | ||||||
|  * distributed under the License is distributed on an "AS IS" BASIS, |  | ||||||
|  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |  | ||||||
|  * See the License for the specific language governing permissions and |  | ||||||
|  * limitations under the License. |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| package top.continew.admin.common.config.mybatis; |  | ||||||
|  |  | ||||||
| import org.springframework.security.crypto.password.PasswordEncoder; |  | ||||||
| import top.continew.starter.security.crypto.encryptor.AbstractEncryptor; |  | ||||||
| import top.continew.starter.security.crypto.encryptor.CryptoContext; |  | ||||||
| import top.continew.starter.security.password.constant.PasswordEncoderConstants; |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * BCrypt 加/解密处理器(不可逆) |  | ||||||
|  * |  | ||||||
|  * @author Charles7c |  | ||||||
|  * @since 2024/2/8 22:29 |  | ||||||
|  */ |  | ||||||
| public class BCryptEncryptor extends AbstractEncryptor { |  | ||||||
|  |  | ||||||
|     private final PasswordEncoder passwordEncoder; |  | ||||||
|  |  | ||||||
|     public BCryptEncryptor(CryptoContext context, PasswordEncoder passwordEncoder) { |  | ||||||
|         super(context); |  | ||||||
|         this.passwordEncoder = passwordEncoder; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @Override |  | ||||||
|     public String encrypt(String plaintext) { |  | ||||||
|         // 如果已经是 BCrypt 加密格式,直接返回 |  | ||||||
|         if (PasswordEncoderConstants.BCRYPT_PATTERN.matcher(plaintext).matches()) { |  | ||||||
|             return plaintext; |  | ||||||
|         } |  | ||||||
|         return passwordEncoder.encode(plaintext); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @Override |  | ||||||
|     public String decrypt(String ciphertext) { |  | ||||||
|         return ciphertext; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.extension.parser.JsqlParserGlobal; | |||||||
| import com.baomidou.mybatisplus.extension.parser.cache.JdkSerialCaffeineJsqlParseCache; | import com.baomidou.mybatisplus.extension.parser.cache.JdkSerialCaffeineJsqlParseCache; | ||||||
| import org.springframework.context.annotation.Bean; | import org.springframework.context.annotation.Bean; | ||||||
| import org.springframework.context.annotation.Configuration; | import org.springframework.context.annotation.Configuration; | ||||||
| import org.springframework.security.crypto.password.PasswordEncoder; |  | ||||||
| import top.continew.starter.extension.datapermission.provider.DataPermissionUserDataProvider; | import top.continew.starter.extension.datapermission.provider.DataPermissionUserDataProvider; | ||||||
|  |  | ||||||
| import java.util.concurrent.TimeUnit; | import java.util.concurrent.TimeUnit; | ||||||
| @@ -56,12 +55,4 @@ public class MybatisPlusConfiguration { | |||||||
|     public DataPermissionUserDataProvider dataPermissionUserDataProvider() { |     public DataPermissionUserDataProvider dataPermissionUserDataProvider() { | ||||||
|         return new DefaultDataPermissionUserDataProvider(); |         return new DefaultDataPermissionUserDataProvider(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * BCrypt 加/解密处理器 |  | ||||||
|      */ |  | ||||||
|     @Bean |  | ||||||
|     public BCryptEncryptor bCryptEncryptor(PasswordEncoder passwordEncoder) { |  | ||||||
|         return new BCryptEncryptor(null, passwordEncoder); |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ application: | |||||||
|   description: 持续迭代优化的前后端分离中后台管理系统框架,开箱即用,持续提供舒适的开发体验。 |   description: 持续迭代优化的前后端分离中后台管理系统框架,开箱即用,持续提供舒适的开发体验。 | ||||||
|   # 版本 |   # 版本 | ||||||
|   version: 4.0.0-SNAPSHOT |   version: 4.0.0-SNAPSHOT | ||||||
|   starter: 2.13.2 |   starter: 2.13.3 | ||||||
|   # 基本包 |   # 基本包 | ||||||
|   base-package: top.continew.admin |   base-package: top.continew.admin | ||||||
|   ## 作者信息配置 |   ## 作者信息配置 | ||||||
| @@ -186,8 +186,8 @@ continew-starter.trace: | |||||||
| continew-starter.security: | continew-starter.security: | ||||||
|   password: |   password: | ||||||
|     enabled: true |     enabled: true | ||||||
|     # BCryptPasswordEncoder(如有改动,需同步调整 top.continew.admin.common.config.mybatis.BCryptEncryptor) |     # 默认启用的编码器算法(默认:BCrypt 加密算法) | ||||||
|     encoding-id: bcrypt |     algorithm: BCRYPT | ||||||
|  |  | ||||||
| --- ### CRUD 配置 | --- ### CRUD 配置 | ||||||
| continew-starter.crud: | continew-starter.crud: | ||||||
|   | |||||||
| @@ -21,11 +21,11 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| import top.continew.admin.common.base.model.entity.TenantBaseDO; | import top.continew.admin.common.base.model.entity.TenantBaseDO; | ||||||
| import top.continew.admin.common.config.mybatis.BCryptEncryptor; |  | ||||||
| import top.continew.admin.common.enums.DisEnableStatusEnum; | import top.continew.admin.common.enums.DisEnableStatusEnum; | ||||||
| import top.continew.admin.common.enums.GenderEnum; | import top.continew.admin.common.enums.GenderEnum; | ||||||
| import top.continew.starter.extension.crud.annotation.DictModel; | import top.continew.starter.extension.crud.annotation.DictModel; | ||||||
| import top.continew.starter.security.crypto.annotation.FieldEncrypt; | import top.continew.starter.security.crypto.annotation.FieldEncrypt; | ||||||
|  | import top.continew.starter.security.crypto.enums.Algorithm; | ||||||
|  |  | ||||||
| import java.io.Serial; | import java.io.Serial; | ||||||
| import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||||
| @@ -57,7 +57,7 @@ public class UserDO extends TenantBaseDO { | |||||||
|     /** |     /** | ||||||
|      * 密码 |      * 密码 | ||||||
|      */ |      */ | ||||||
|     @FieldEncrypt(encryptor = BCryptEncryptor.class) |     @FieldEncrypt(Algorithm.PASSWORD_ENCODER) | ||||||
|     private String password; |     private String password; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|   | |||||||
| @@ -83,10 +83,4 @@ public class DeptResp extends BaseDetailResp { | |||||||
|     @Schema(description = "描述", example = "测试部描述信息") |     @Schema(description = "描述", example = "测试部描述信息") | ||||||
|     @ExcelProperty(value = "描述", order = 8) |     @ExcelProperty(value = "描述", order = 8) | ||||||
|     private String description; |     private String description; | ||||||
|  |  | ||||||
|     // TODO 临时修复,等待 ContiNew Starter 2.13.3 发布移除 |  | ||||||
|     @Override |  | ||||||
|     public Long getId() { |  | ||||||
|         return super.getId(); |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -122,10 +122,4 @@ public class MenuResp extends BaseResp { | |||||||
|      */ |      */ | ||||||
|     @Schema(description = "状态", example = "1") |     @Schema(description = "状态", example = "1") | ||||||
|     private DisEnableStatusEnum status; |     private DisEnableStatusEnum status; | ||||||
|  |  | ||||||
|     // TODO 临时修复,等待 ContiNew Starter 2.13.3 发布移除 |  | ||||||
|     @Override |  | ||||||
|     public Long getId() { |  | ||||||
|         return super.getId(); |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -18,6 +18,7 @@ package top.continew.admin.system.service.impl; | |||||||
|  |  | ||||||
| import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||||
| import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||||
|  | import cn.hutool.core.lang.tree.Tree; | ||||||
| import cn.hutool.core.util.StrUtil; | import cn.hutool.core.util.StrUtil; | ||||||
| import com.alicp.jetcache.anno.Cached; | import com.alicp.jetcache.anno.Cached; | ||||||
| import jakarta.annotation.Resource; | import jakarta.annotation.Resource; | ||||||
| @@ -42,6 +43,7 @@ import top.continew.starter.cache.redisson.util.RedisUtils; | |||||||
| import top.continew.starter.core.constant.StringConstants; | import top.continew.starter.core.constant.StringConstants; | ||||||
| import top.continew.starter.core.util.CollUtils; | import top.continew.starter.core.util.CollUtils; | ||||||
| import top.continew.starter.core.util.validation.CheckUtils; | import top.continew.starter.core.util.validation.CheckUtils; | ||||||
|  | import top.continew.starter.extension.crud.model.query.SortQuery; | ||||||
|  |  | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import java.util.Set; | import java.util.Set; | ||||||
| @@ -60,6 +62,11 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, MenuDO, MenuRes | |||||||
|     @Resource |     @Resource | ||||||
|     private RoleService roleService; |     private RoleService roleService; | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public List<Tree<Long>> tree(MenuQuery query, SortQuery sortQuery, boolean isSimple) { | ||||||
|  |         return this.tree(query, sortQuery, isSimple, true); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public Long create(MenuReq req) { |     public Long create(MenuReq req) { | ||||||
|         this.checkTitleRepeat(req.getTitle(), req.getParentId(), null); |         this.checkTitleRepeat(req.getTitle(), req.getParentId(), null); | ||||||
|   | |||||||
| @@ -85,7 +85,7 @@ import top.continew.starter.core.util.validation.CheckUtils; | |||||||
| import top.continew.starter.extension.crud.model.query.PageQuery; | import top.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.continew.starter.extension.crud.model.query.SortQuery; | import top.continew.starter.extension.crud.model.query.SortQuery; | ||||||
| import top.continew.starter.extension.crud.model.resp.PageResp; | import top.continew.starter.extension.crud.model.resp.PageResp; | ||||||
| import top.continew.starter.security.crypto.utils.EncryptHelper; | import top.continew.starter.security.crypto.util.EncryptHelper; | ||||||
|  |  | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| import java.time.Duration; | import java.time.Duration; | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							| @@ -13,7 +13,7 @@ | |||||||
|     <parent> |     <parent> | ||||||
|         <groupId>top.continew.starter</groupId> |         <groupId>top.continew.starter</groupId> | ||||||
|         <artifactId>continew-starter</artifactId> |         <artifactId>continew-starter</artifactId> | ||||||
|         <version>2.13.2</version> |         <version>2.13.3</version> | ||||||
|     </parent> |     </parent> | ||||||
|  |  | ||||||
|     <groupId>top.continew.admin</groupId> |     <groupId>top.continew.admin</groupId> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user