diff --git a/src/main/java/com/rymcu/forest/service/impl/TagServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/TagServiceImpl.java index 62504c8..09b4680 100644 --- a/src/main/java/com/rymcu/forest/service/impl/TagServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/TagServiceImpl.java @@ -144,7 +144,7 @@ public class TagServiceImpl extends AbstractService implements TagService { newTag.setTagTitle(tag.getTagTitle()); newTag.setTagUri(tag.getTagUri()); if (StringUtils.isNotBlank(tag.getTagIconPath()) && tag.getTagIconPath().contains("base64")) { - String tagIconPath = UploadController.uploadBase64File(tag.getTagIconPath(), 0); + String tagIconPath = UploadController.uploadBase64File(tag.getTagIconPath(), 2); newTag.setTagIconPath(tagIconPath); } else { newTag.setTagIconPath(tag.getTagIconPath()); @@ -158,7 +158,7 @@ public class TagServiceImpl extends AbstractService implements TagService { } else { tag.setUpdatedTime(new Date()); if (StringUtils.isNotBlank(tag.getTagIconPath()) && tag.getTagIconPath().contains("base64")) { - String tagIconPath = UploadController.uploadBase64File(tag.getTagIconPath(), 0); + String tagIconPath = UploadController.uploadBase64File(tag.getTagIconPath(), 2); tag.setTagIconPath(tagIconPath); } result = tagMapper.update(tag.getIdTag(), tag.getTagUri(), tag.getTagIconPath(), tag.getTagStatus(), tag.getTagDescription(), tag.getTagReservation()); diff --git a/src/main/java/com/rymcu/forest/service/impl/TopicServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/TopicServiceImpl.java index 4b3d021..8ee2856 100644 --- a/src/main/java/com/rymcu/forest/service/impl/TopicServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/TopicServiceImpl.java @@ -66,7 +66,7 @@ public class TopicServiceImpl extends AbstractService implements TopicSer newTopic.setTopicTitle(topic.getTopicTitle()); newTopic.setTopicUri(topic.getTopicUri()); if (StringUtils.isNotBlank(topic.getTopicIconPath()) && topic.getTopicIconPath().contains("base64")) { - String topicIconPath = UploadController.uploadBase64File(topic.getTopicIconPath(), 0); + String topicIconPath = UploadController.uploadBase64File(topic.getTopicIconPath(), 3); newTopic.setTopicIconPath(topicIconPath); } else { newTopic.setTopicIconPath(topic.getTopicIconPath()); @@ -81,7 +81,7 @@ public class TopicServiceImpl extends AbstractService implements TopicSer result = topicMapper.insertSelective(newTopic); } else { if (StringUtils.isNotBlank(topic.getTopicIconPath()) && topic.getTopicIconPath().contains("base64")) { - String topicIconPath = UploadController.uploadBase64File(topic.getTopicIconPath(), 0); + String topicIconPath = UploadController.uploadBase64File(topic.getTopicIconPath(), 3); topic.setTopicIconPath(topicIconPath); } topic.setUpdatedTime(new Date()); diff --git a/src/main/java/com/rymcu/forest/web/api/common/UploadController.java b/src/main/java/com/rymcu/forest/web/api/common/UploadController.java index 565a231..5ea38c9 100644 --- a/src/main/java/com/rymcu/forest/web/api/common/UploadController.java +++ b/src/main/java/com/rymcu/forest/web/api/common/UploadController.java @@ -57,7 +57,10 @@ public class UploadController { typePath = "article"; break; case 2: - typePath = "tags"; + typePath = "tag"; + break; + case 3: + typePath = "topic"; break; default: typePath = "images";