5 Commits
tmp ... dev

Author SHA1 Message Date
6e7db4f418 feat(system/auth): 新增微信开放平台登录配置示例 2025-10-17 21:39:44 +08:00
37539ae8a8 fix(system/message): 修复查询用户未读消息错误
Closes #ID2803
2025-10-16 20:11:52 +08:00
9b5eab6a34 chore: 优化接口默认失败、成功提示 2025-10-14 20:57:29 +08:00
9bfde6f6a3 fix(system/message): 修复查看消息详情报错的问题
Closes #193
2025-10-14 20:53:15 +08:00
541e53ea26 build: continew-starter 2.13.4 => 2.14.0
1.适配 cs security-crypto 模块拆分及包名调整,重新引入密码编码器模块
2.适配 cs 树型结构字典配置命名调整 DICT_TREE -> TREE_DICT
3.cs QueryIgnore 已移除,自行处理所有 Query 参数
4.cs 修复多租户下开启多数据源拦截器返回结果异常的情况
5.cs 修复邮箱发送错误
2025-10-03 22:37:08 +08:00
20 changed files with 56 additions and 50 deletions

View File

@@ -6,7 +6,7 @@ body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
感谢您使用 ContiNew Admin请您花些时间填写这份 Bug 报告。 感谢您使用 ContiNew Admin请您花些时间填写这份 Bug 报告。**温馨提示:我们利用业余时间维护开源项目,没有额外精力及人员维护已发布版本,所以请务必检查最新版本是否正常,如已修复请自行跟进修复!**
- type: checkboxes - type: checkboxes
id: checkboxes id: checkboxes
attributes: attributes:

View File

@@ -4,7 +4,7 @@
<img src="https://img.shields.io/badge/SNAPSHOT-v4.1.0-%23ff3f59.svg" alt="Release" /> <img src="https://img.shields.io/badge/SNAPSHOT-v4.1.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.4-%236CB52D.svg" alt="ContiNew Starter" /> <img src="https://img.shields.io/badge/ContiNew Starter-2.14.0-%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" />
@@ -240,7 +240,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.4 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken可轻松集成到应用中为开发人员减少手动引入依赖及配置的麻烦为 Spring Boot Web 项目的灵活快速构建提供支持。 | | [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.14.0 | 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 权限认证框架,让鉴权变得简单、优雅。 |

View File

@@ -33,14 +33,9 @@ import org.springframework.boot.SpringBootVersion;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import top.continew.admin.common.context.UserContext;
import top.continew.admin.common.context.UserContextHolder;
import top.continew.starter.core.autoconfigure.application.ApplicationProperties; import top.continew.starter.core.autoconfigure.application.ApplicationProperties;
import top.continew.starter.core.util.SpringUtils;
import top.continew.starter.extension.crud.annotation.EnableCrudApi; import top.continew.starter.extension.crud.annotation.EnableCrudApi;
import top.continew.starter.web.annotation.EnableGlobalResponse; import top.continew.starter.web.annotation.EnableGlobalResponse;
import top.continew.starter.web.model.R; import top.continew.starter.web.model.R;
@@ -64,7 +59,6 @@ public class ContiNewAdminApplication implements ApplicationRunner {
private final ApplicationProperties applicationProperties; private final ApplicationProperties applicationProperties;
private final ServerProperties serverProperties; private final ServerProperties serverProperties;
private final ThreadPoolTaskExecutor threadPoolTaskExecutor;
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ContiNewAdminApplication.class, args); SpringApplication.run(ContiNewAdminApplication.class, args);
@@ -99,15 +93,5 @@ public class ContiNewAdminApplication implements ApplicationRunner {
log.info("更新日志: https://continew.top/docs/admin/changelog/"); log.info("更新日志: https://continew.top/docs/admin/changelog/");
log.info("ContiNew Admin: 持续迭代优化的,高质量多租户中后台管理系统框架"); log.info("ContiNew Admin: 持续迭代优化的,高质量多租户中后台管理系统框架");
log.info("--------------------------------------------------------"); log.info("--------------------------------------------------------");
UserContext userContext = new UserContext();
userContext.setId(222L);
UserContextHolder.setContext(userContext);
log.info("userId: {}", UserContextHolder.getUserId());
SpringUtils.getProxy(this).async();
}
@Async
public void async() {
log.info("async: {}", UserContextHolder.getUserId());
} }
} }

View File

@@ -238,6 +238,10 @@ sa-token.extension:
justauth: justauth:
enabled: true enabled: true
type: type:
WECHAT_OPEN:
client-id: wx4a**********bcc2
client-secret: 32e5*************************1ef
redirect-uri: ${application.url}/social/callback?source=wechat_open
GITEE: GITEE:
client-id: 5d271b7f638941812aaf8bfc2e2f08f06d6235ef934e0e39537e2364eb8452c4 client-id: 5d271b7f638941812aaf8bfc2e2f08f06d6235ef934e0e39537e2364eb8452c4
client-secret: 1f7d08**********5b7**********29e client-secret: 1f7d08**********5b7**********29e

View File

@@ -240,6 +240,10 @@ sa-token.extension:
justauth: justauth:
enabled: true enabled: true
type: type:
WECHAT_OPEN:
client-id: wx4a**********bcc2
client-secret: 32e5*************************1ef
redirect-uri: ${application.url}/social/callback?source=wechat_open
GITEE: GITEE:
client-id: 5d271b7f638941812aaf8bfc2e2f08f06d6235ef934e0e39537e2364eb8452c4 client-id: 5d271b7f638941812aaf8bfc2e2f08f06d6235ef934e0e39537e2364eb8452c4
client-secret: 1f7d08**********5b7**********29e client-secret: 1f7d08**********5b7**********29e

View File

@@ -7,7 +7,7 @@ application:
description: 持续迭代优化的前后端分离中后台管理系统框架,开箱即用,持续提供舒适的开发体验。 description: 持续迭代优化的前后端分离中后台管理系统框架,开箱即用,持续提供舒适的开发体验。
# 版本 # 版本
version: 4.1.0-SNAPSHOT version: 4.1.0-SNAPSHOT
starter: 2.13.4 starter: 2.14.0
# 基本包 # 基本包
base-package: top.continew.admin base-package: top.continew.admin
## 作者信息配置 ## 作者信息配置
@@ -142,11 +142,11 @@ continew-starter.web.response:
# 自定义成功响应码默认0 # 自定义成功响应码默认0
default-success-code: 0 default-success-code: 0
# 自定义成功提示默认ok # 自定义成功提示默认ok
default-success-msg: ok default-success-msg: 操作成功
# 自定义失败响应码默认1 # 自定义失败响应码默认1
default-error-code: 1 default-error-code: 1
# 自定义失败提示默认error # 自定义失败提示默认error
default-error-msg: error default-error-msg: 服务器异常,请联系管理员
# 是否将原生异常错误信息填充到状态信息中 # 是否将原生异常错误信息填充到状态信息中
origin-exception-using-detail-message: false origin-exception-using-detail-message: false
# 响应类全名(配置后 response-style 将不再生效) # 响应类全名(配置后 response-style 将不再生效)

View File

@@ -16,6 +16,7 @@
package top.continew.admin.system.controller; package top.continew.admin.system.controller;
import cn.hutool.core.collection.CollUtil;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.enums.ParameterIn;
@@ -81,8 +82,8 @@ public class UserMessageController {
@GetMapping("/{id}") @GetMapping("/{id}")
public MessageDetailResp getMessage(@PathVariable Long id) { public MessageDetailResp getMessage(@PathVariable Long id) {
MessageDetailResp detail = messageService.get(id); MessageDetailResp detail = messageService.get(id);
CheckUtils.throwIf(detail == null || (NoticeScopeEnum.USER.equals(detail.getScope()) && !detail.getUsers() CheckUtils.throwIf(detail == null || (NoticeScopeEnum.USER.equals(detail.getScope()) && !CollUtil
.contains(UserContextHolder.getUserId().toString())), "消息不存在或无权限访问"); .contains(detail.getUsers(), UserContextHolder.getUserId().toString())), "消息不存在或无权限访问");
messageService.readMessage(Collections.singletonList(id), UserContextHolder.getUserId()); messageService.readMessage(Collections.singletonList(id), UserContextHolder.getUserId());
detail.setIsRead(true); detail.setIsRead(true);
return detail; return detail;

View File

@@ -29,6 +29,11 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor @RequiredArgsConstructor
public enum SocialSourceEnum { public enum SocialSourceEnum {
/**
* 微信
*/
WECHAT_OPEN("微信"),
/** /**
* 码云 * 码云
*/ */

View File

@@ -44,6 +44,7 @@ public class ClientQuery implements Serializable {
* 客户端类型 * 客户端类型
*/ */
@Schema(description = "客户端类型", example = "PC") @Schema(description = "客户端类型", example = "PC")
@Query(type = QueryType.EQ)
private String clientType; private String clientType;
/** /**
@@ -57,5 +58,6 @@ public class ClientQuery implements Serializable {
* 状态 * 状态
*/ */
@Schema(description = "状态", example = "1") @Schema(description = "状态", example = "1")
@Query(type = QueryType.EQ)
private DisEnableStatusEnum status; private DisEnableStatusEnum status;
} }

View File

@@ -49,5 +49,6 @@ public class DeptQuery implements Serializable {
* 状态 * 状态
*/ */
@Schema(description = "状态", example = "1") @Schema(description = "状态", example = "1")
@Query(type = QueryType.EQ)
private DisEnableStatusEnum status; private DisEnableStatusEnum status;
} }

View File

@@ -49,11 +49,13 @@ public class DictItemQuery implements Serializable {
* 状态 * 状态
*/ */
@Schema(description = "状态", example = "1") @Schema(description = "状态", example = "1")
@Query(type = QueryType.EQ)
private DisEnableStatusEnum status; private DisEnableStatusEnum status;
/** /**
* 字典 ID * 字典 ID
*/ */
@Schema(description = "字典 ID") @Schema(description = "字典 ID")
@Query(type = QueryType.EQ)
private Long dictId; private Long dictId;
} }

View File

@@ -49,11 +49,13 @@ public class FileQuery implements Serializable {
* 上级目录 * 上级目录
*/ */
@Schema(description = "上级目录", example = "/") @Schema(description = "上级目录", example = "/")
@Query(type = QueryType.EQ)
private String parentPath; private String parentPath;
/** /**
* 类型 * 类型
*/ */
@Schema(description = "类型", example = "2") @Schema(description = "类型", example = "2")
@Query(type = QueryType.EQ)
private FileTypeEnum type; private FileTypeEnum type;
} }

View File

@@ -52,6 +52,7 @@ public class MenuQuery implements Serializable {
* 状态 * 状态
*/ */
@Schema(description = "状态", example = "1") @Schema(description = "状态", example = "1")
@Query(type = QueryType.EQ)
private DisEnableStatusEnum status; private DisEnableStatusEnum status;
public MenuQuery(DisEnableStatusEnum status) { public MenuQuery(DisEnableStatusEnum status) {

View File

@@ -51,6 +51,7 @@ public class OptionQuery implements Serializable {
* 类别 * 类别
*/ */
@Schema(description = "类别", example = "SITE") @Schema(description = "类别", example = "SITE")
@Query(type = QueryType.EQ)
@EnumValue(value = OptionCategoryEnum.class, message = "类别无效") @EnumValue(value = OptionCategoryEnum.class, message = "类别无效")
private String category; private String category;
} }

View File

@@ -50,19 +50,20 @@ public class SmsConfigQuery implements Serializable {
* 厂商 * 厂商
*/ */
@Schema(description = "厂商", example = "cloopen") @Schema(description = "厂商", example = "cloopen")
@Query @Query(type = QueryType.EQ)
private String supplier; private String supplier;
/** /**
* Access Key * Access Key
*/ */
@Schema(description = "Access Key", example = "7aaf0708674db3ee05676ecbc2f31b7b") @Schema(description = "Access Key", example = "7aaf0708674db3ee05676ecbc2f31b7b")
@Query @Query(type = QueryType.EQ)
private String accessKey; private String accessKey;
/** /**
* 状态 * 状态
*/ */
@Schema(description = "状态", example = "1") @Schema(description = "状态", example = "1")
@Query(type = QueryType.EQ)
private DisEnableStatusEnum status; private DisEnableStatusEnum status;
} }

View File

@@ -20,6 +20,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import top.continew.admin.common.enums.SuccessFailureStatusEnum; import top.continew.admin.common.enums.SuccessFailureStatusEnum;
import top.continew.starter.data.annotation.Query; import top.continew.starter.data.annotation.Query;
import top.continew.starter.data.enums.QueryType;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
@@ -42,20 +43,20 @@ public class SmsLogQuery implements Serializable {
* 配置 ID * 配置 ID
*/ */
@Schema(description = "配置 ID", example = "1") @Schema(description = "配置 ID", example = "1")
@Query @Query(type = QueryType.EQ)
private Long configId; private Long configId;
/** /**
* 手机号 * 手机号
*/ */
@Schema(description = "手机号", example = "18888888888") @Schema(description = "手机号", example = "18888888888")
@Query @Query(type = QueryType.EQ)
private String phone; private String phone;
/** /**
* 发送状态 * 发送状态
*/ */
@Schema(description = "发送状态", example = "1") @Schema(description = "发送状态", example = "1")
@Query @Query(type = QueryType.EQ)
private SuccessFailureStatusEnum status; private SuccessFailureStatusEnum status;
} }

View File

@@ -50,11 +50,13 @@ public class StorageQuery implements Serializable {
* 状态 * 状态
*/ */
@Schema(description = "状态", example = "1") @Schema(description = "状态", example = "1")
@Query(type = QueryType.EQ)
private DisEnableStatusEnum status; private DisEnableStatusEnum status;
/** /**
* 类型 * 类型
*/ */
@Schema(description = "类型", example = "2") @Schema(description = "类型", example = "2")
@Query(type = QueryType.EQ)
private StorageTypeEnum type; private StorageTypeEnum type;
} }

View File

@@ -81,21 +81,15 @@ public class MessageDetailResp implements Serializable {
@Schema(description = "通知用户", example = "[1,2]") @Schema(description = "通知用户", example = "[1,2]")
private List<String> users; private List<String> users;
/**
* 是否已读
*/
@Schema(description = "是否已读", example = "true")
private Boolean isRead;
/**
* 读取时间
*/
@Schema(description = "读取时间", example = "2023-08-08 23:59:59", type = "string")
private LocalDateTime readTime;
/** /**
* 创建时间 * 创建时间
*/ */
@Schema(description = "创建时间", example = "2023-08-08 08:08:08", type = "string") @Schema(description = "创建时间", example = "2023-08-08 08:08:08", type = "string")
private LocalDateTime createTime; private LocalDateTime createTime;
/**
* 是否已读
*/
@Schema(description = "是否已读", example = "true")
private Boolean isRead;
} }

View File

@@ -2,6 +2,11 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" > "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.MessageMapper"> <mapper namespace="top.continew.admin.system.mapper.MessageMapper">
<resultMap id="messageDetailMap" type="top.continew.admin.system.model.resp.message.MessageDetailResp">
<id column="id" property="id" />
<result property="users" column="users" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
</resultMap>
<select id="selectMessagePage" resultType="top.continew.admin.system.model.resp.message.MessageResp"> <select id="selectMessagePage" resultType="top.continew.admin.system.model.resp.message.MessageResp">
SELECT SELECT
t1.id, t1.id,
@@ -9,17 +14,16 @@
t1.type, t1.type,
t1.path, t1.path,
t1.scope, t1.scope,
t1.users,
t1.create_time, t1.create_time,
t2.read_time IS NOT NULL AS isRead, t2.read_time IS NOT NULL AS isRead,
t2.read_time AS readTime t2.read_time AS readTime
FROM sys_message AS t1 FROM sys_message AS t1
LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id <if test="query.userId != null">AND t2.user_id = #{query.userId}</if>
<where> <where>
<if test="query.userId != null"> <if test="query.userId != null">
<choose> <choose>
<when test="_databaseId == 'mysql'"> <when test="_databaseId == 'mysql'">
(t1.scope = 1 OR (t1.scope = 2 AND JSON_EXTRACT(t1.users, "$[0]") = CAST(#{query.userId} AS CHAR))) (t1.scope = 1 OR (t1.scope = 2 AND JSON_CONTAINS(t1.users, CONCAT('"', #{query.userId}, '"'))))
</when> </when>
<when test="_databaseId == 'pgsql'"> <when test="_databaseId == 'pgsql'">
(t1.scope = 1 OR (t1.scope = 2 AND t1.users::jsonb @> jsonb_build_array(#{query.userId}::text))) (t1.scope = 1 OR (t1.scope = 2 AND t1.users::jsonb @> jsonb_build_array(#{query.userId}::text)))
@@ -39,7 +43,7 @@
ORDER BY t1.create_time DESC ORDER BY t1.create_time DESC
</select> </select>
<select id="selectMessageById" resultType="top.continew.admin.system.model.resp.message.MessageDetailResp"> <select id="selectMessageById" resultMap="messageDetailMap">
SELECT SELECT
t1.id, t1.id,
t1.title, t1.title,
@@ -48,11 +52,8 @@
t1.path, t1.path,
t1.scope, t1.scope,
t1.users, t1.users,
t1.create_time, t1.create_time
t2.read_time IS NOT NULL AS isRead,
t2.read_time AS readTime
FROM sys_message AS t1 FROM sys_message AS t1
LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id
WHERE t1.id = #{id} WHERE t1.id = #{id}
</select> </select>

View File

@@ -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.14.0-SNAPSHOT</version> <version>2.14.0</version>
</parent> </parent>
<groupId>top.continew.admin</groupId> <groupId>top.continew.admin</groupId>