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