Skip to content

Commit

Permalink
🐛 缩略图统一改为绝对路径
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby committed Feb 24, 2019
1 parent 8e8471e commit 585e1e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public JsonResult pushPage(@ModelAttribute Post post, HttpSession session) {
post.setPostContent(MarkdownUtils.renderMarkdown(post.getPostContentMd()));
//当没有选择文章缩略图的时候,自动分配一张内置的缩略图
if (StrUtil.equals(post.getPostThumbnail(), BlogPropertiesEnum.DEFAULT_THUMBNAIL.getProp())) {
post.setPostThumbnail("/static/halo-frontend/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 11) + ".jpg");
post.setPostThumbnail(OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()) + "/static/halo-frontend/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 11) + ".jpg");
}
postService.create(post);
logsService.save(LogsRecord.PUSH_PAGE, post.getPostTitle(), request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public JsonResult save(@ModelAttribute Post post,
}
//当没有选择文章缩略图的时候,自动分配一张内置的缩略图
if (StrUtil.equals(post.getPostThumbnail(), BlogPropertiesEnum.DEFAULT_THUMBNAIL.getProp())) {
post.setPostThumbnail("/static/halo-frontend/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 11) + ".jpg");
post.setPostThumbnail(OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()) + "/static/halo-frontend/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 11) + ".jpg");
}
postService.create(post);
logsService.save(LogsRecord.PUSH_POST, post.getPostTitle(), request);
Expand Down Expand Up @@ -189,7 +189,7 @@ public JsonResult update(@ModelAttribute Post post,
}
//当没有选择文章缩略图的时候,自动分配一张内置的缩略图
if (StrUtil.equals(post.getPostThumbnail(), BlogPropertiesEnum.DEFAULT_THUMBNAIL.getProp())) {
post.setPostThumbnail("/static/halo-frontend/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 11) + ".jpg");
post.setPostThumbnail(OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()) + "/static/halo-frontend/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 11) + ".jpg");
}
post = postService.create(post);
if (null != post) {
Expand Down

0 comments on commit 585e1e4

Please sign in to comment.