Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #748 #749

Merged
merged 1 commit into from
Apr 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ public void handleCommentNewEvent(CommentNewEvent newEvent) {

User user = userService.getCurrentUser().orElseThrow(() -> new ServiceException("未查询到博主信息"));


Map<String, Object> data = new HashMap<>();

StringBuilder subject = new StringBuilder();

Boolean enabledAbsolutePath = optionService.isEnabledAbsolutePath();

if (newEvent.getSource() instanceof PostCommentService) {
// Get postComment id
PostComment postComment = postCommentService.getById(newEvent.getCommentId());
Expand All @@ -93,7 +94,7 @@ public void handleCommentNewEvent(CommentNewEvent newEvent) {

BasePostMinimalDTO post = postService.convertToMinimal(postService.getById(postComment.getPostId()));

data.put("pageFullPath", post.getFullPath());
data.put("pageFullPath", enabledAbsolutePath ? post.getFullPath() : optionService.getBlogBaseUrl() + post.getFullPath());
data.put("pageTitle", post.getTitle());
data.put("author", postComment.getAuthor());
data.put("content", postComment.getContent());
Expand All @@ -109,7 +110,7 @@ public void handleCommentNewEvent(CommentNewEvent newEvent) {

BasePostMinimalDTO sheet = sheetService.convertToMinimal(sheetService.getById(sheetComment.getPostId()));

data.put("pageFullPath", sheet.getFullPath());
data.put("pageFullPath", enabledAbsolutePath ? sheet.getFullPath() : optionService.getBlogBaseUrl() + sheet.getFullPath());
data.put("pageTitle", sheet.getTitle());
data.put("author", sheetComment.getAuthor());
data.put("content", sheetComment.getContent());
Expand Down Expand Up @@ -167,6 +168,8 @@ public void handleCommentReplyEvent(CommentReplyEvent replyEvent) {

StringBuilder subject = new StringBuilder();

Boolean enabledAbsolutePath = optionService.isEnabledAbsolutePath();

log.debug("replyEvent.getSource():" + replyEvent.getSource().toString());

if (replyEvent.getSource() instanceof PostCommentService) {
Expand All @@ -187,7 +190,7 @@ public void handleCommentReplyEvent(CommentReplyEvent replyEvent) {

BasePostMinimalDTO post = postService.convertToMinimal(postService.getById(postComment.getPostId()));

data.put("pageFullPath", post.getFullPath());
data.put("pageFullPath", enabledAbsolutePath ? post.getFullPath() : optionService.getBlogBaseUrl() + post.getFullPath());
data.put("pageTitle", post.getTitle());
data.put("baseAuthor", baseComment.getAuthor());
data.put("baseContent", baseComment.getContent());
Expand Down Expand Up @@ -217,7 +220,7 @@ public void handleCommentReplyEvent(CommentReplyEvent replyEvent) {

BasePostMinimalDTO sheet = sheetService.convertToMinimal(sheetService.getById(sheetComment.getPostId()));

data.put("pageFullPath", sheet.getFullPath());
data.put("pageFullPath", enabledAbsolutePath ? sheet.getFullPath() : optionService.getBlogBaseUrl() + sheet.getFullPath());
data.put("pageTitle", sheet.getTitle());
data.put("baseAuthor", baseComment.getAuthor());
data.put("baseContent", baseComment.getContent());
Expand Down