From cb4eb1b1b6b6172fa2c84f9505b821f0e823019d Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Wed, 5 Nov 2025 13:34:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/module/course/api/CourseManageApi.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseManageApi.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseManageApi.java index 33062684..df9fd329 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseManageApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseManageApi.java @@ -286,6 +286,16 @@ public class CourseManageApi extends ApiBaseController{ log.info("-------- 标签相关开始 ------- 课程ID = {} " , dto.getCourse().getId()); CurrentUser userInfo = getCurrent(); Course oldCourse = StringUtils.isBlank(dto.getCourse().getId()) ? null : courseService.get(dto.getCourse().getId()); + if(oldCourse!=null && StringUtils.isNotEmpty(oldCourse.getTags())){ + String[] tagArray = oldCourse.getTags().split(","); + // 检查每个元素是否为纯数字 + for (String tag : tagArray) { + if (!tag.matches("\\d+")) { // 使用正则表达式检查是否为纯数字 + oldCourse.setTags(null); // 兼容 + break; + } + } + } tagService.updateTags(oldCourse,dto.getCourse(),userInfo); log.info("-------- 标签相关结束 -------");