From b9ccd13511cb63b91ad6019381ddfd6cf04ec0ac Mon Sep 17 00:00:00 2001 From: xusd Date: Tue, 30 Apr 2024 17:59:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B1=95=E8=A7=84=E5=88=92-=E5=AD=A6?= =?UTF-8?q?=E4=B9=A0=E8=B7=AF=E5=BE=84=E6=A8=A1=E5=9D=97=20=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/inspur/develop/domain/LearningPathInfo.java | 2 ++ .../service/impl/LearningPathInfoServiceImpl.java | 9 +++++++++ inspur-ui/src/views/develop/learningPath/index.vue | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/inspur-service/inspur-develop/src/main/java/com/inspur/develop/domain/LearningPathInfo.java b/inspur-service/inspur-develop/src/main/java/com/inspur/develop/domain/LearningPathInfo.java index a7892ff..29dac54 100644 --- a/inspur-service/inspur-develop/src/main/java/com/inspur/develop/domain/LearningPathInfo.java +++ b/inspur-service/inspur-develop/src/main/java/com/inspur/develop/domain/LearningPathInfo.java @@ -62,4 +62,6 @@ public class LearningPathInfo extends BaseEntity { */ private List learningPathCourseList; + private String photoBase; + } diff --git a/inspur-service/inspur-develop/src/main/java/com/inspur/develop/service/impl/LearningPathInfoServiceImpl.java b/inspur-service/inspur-develop/src/main/java/com/inspur/develop/service/impl/LearningPathInfoServiceImpl.java index a5c837c..e60ece6 100644 --- a/inspur-service/inspur-develop/src/main/java/com/inspur/develop/service/impl/LearningPathInfoServiceImpl.java +++ b/inspur-service/inspur-develop/src/main/java/com/inspur/develop/service/impl/LearningPathInfoServiceImpl.java @@ -1,9 +1,11 @@ package com.inspur.service.impl; +import java.util.Base64; import java.util.List; import java.util.Objects; import cn.hutool.core.util.StrUtil; +import com.inspur.common.sftp.ISFTPServices; import com.inspur.common.utils.DateUtils; import com.inspur.common.utils.SecurityUtils; import com.inspur.common.utils.StringUtils; @@ -33,6 +35,9 @@ public class LearningPathInfoServiceImpl implements ILearningPathInfoService @Autowired private ILearningPathCourseService learningPathCourseService; + @Autowired + private ISFTPServices sftpServices; + /** * 查询学习路径信息 * @@ -45,6 +50,10 @@ public class LearningPathInfoServiceImpl implements ILearningPathInfoService LearningPathInfo learningPathInfo = learningPathInfoMapper.selectLearningPathInfoById(id); if (Objects.nonNull(learningPathInfo)){ learningPathInfo.setLearningPathCourseList(learningPathCourseService.selectLearningPathCourseByPathId(id)); + if (StringUtils.isNotEmpty(learningPathInfo.getFileName())){ + byte[] bytes = sftpServices.downLoadFile(learningPathInfo.getFileName()); + learningPathInfo.setPhotoBase("data:image/png;base64,"+Base64.getEncoder().encodeToString(bytes)); + } } return learningPathInfo; } diff --git a/inspur-ui/src/views/develop/learningPath/index.vue b/inspur-ui/src/views/develop/learningPath/index.vue index 2816966..e451ed7 100644 --- a/inspur-ui/src/views/develop/learningPath/index.vue +++ b/inspur-ui/src/views/develop/learningPath/index.vue @@ -361,7 +361,7 @@
学习路径
- + learningPathForm.fileName