mirror of https://github.com/halo-dev/halo
🐛 缩略图统一改为绝对路径
parent
8e8471e331
commit
585e1e4329
|
@ -253,7 +253,7 @@ public class PageController {
|
|||
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);
|
||||
|
|
|
@ -150,7 +150,7 @@ public class PostController extends BaseController {
|
|||
}
|
||||
//当没有选择文章缩略图的时候,自动分配一张内置的缩略图
|
||||
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);
|
||||
|
@ -189,7 +189,7 @@ public class PostController extends BaseController {
|
|||
}
|
||||
//当没有选择文章缩略图的时候,自动分配一张内置的缩略图
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue