Merge remote-tracking branch 'origin/dev' into dev

pull/167/head
ruibaby 2019-05-23 15:21:16 +08:00
commit b187c5e5c7
7 changed files with 16 additions and 9 deletions

View File

@ -1,4 +1,4 @@
FROM openjdk:8-jdk-alpine
FROM openjdk:8-jre-alpine
VOLUME /tmp

View File

@ -70,7 +70,7 @@ public class CommentEventListener {
Map<String, Object> data = new HashMap<>();
if (newEvent.getSource() instanceof PostService) {
if (newEvent.getSource() instanceof PostCommentService) {
// Get postComment id
PostComment postComment = postCommentService.getById(newEvent.getCommentId());
@ -85,7 +85,7 @@ public class CommentEventListener {
data.put("page", post.getTitle());
data.put("author", postComment.getAuthor());
data.put("content", postComment.getContent());
} else if (newEvent.getSource() instanceof SheetService) {
} else if (newEvent.getSource() instanceof SheetCommentService) {
SheetComment sheetComment = sheetCommentService.getById(newEvent.getCommentId());
log.debug("Got sheet comment: [{}]", sheetComment);
@ -99,7 +99,7 @@ public class CommentEventListener {
data.put("page", sheet.getTitle());
data.put("author", sheetComment.getAuthor());
data.put("content", sheetComment.getContent());
} else if (newEvent.getSource() instanceof JournalService) {
} else if (newEvent.getSource() instanceof JournalCommentService) {
JournalComment journalComment = journalCommentService.getById(newEvent.getCommentId());
log.debug("Got journal comment: [{}]", journalComment);

View File

@ -78,6 +78,7 @@ public class FreemarkerConfigAwareListener {
log.debug("Received option updated event");
loadOptionsConfig();
loadThemeConfig();
}

View File

@ -192,7 +192,7 @@ public class AdminServiceImpl implements AdminService {
Assert.hasText(refreshToken, "Refresh token must not be blank");
Integer userId = cacheStore.getAny(SecurityUtils.buildTokenRefreshKey(refreshToken), Integer.class)
.orElseThrow(() -> new BadRequestException("The refresh token may have been expired already").setErrorData(refreshToken));
.orElseThrow(() -> new BadRequestException("登陆状态已失效,请重新登陆").setErrorData(refreshToken));
// Get user info
User user = userService.getById(userId);

View File

@ -1,5 +1,6 @@
package run.halo.app.service.impl;
import cn.hutool.core.util.URLUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
@ -55,13 +56,10 @@ import java.util.stream.Collectors;
@Slf4j
public abstract class BaseCommentServiceImpl<COMMENT extends BaseComment> extends AbstractCrudService<COMMENT, Long> implements BaseCommentService<COMMENT> {
private final BaseCommentRepository<COMMENT> baseCommentRepository;
protected final OptionService optionService;
protected final UserService userService;
protected final ApplicationEventPublisher eventPublisher;
private final BaseCommentRepository<COMMENT> baseCommentRepository;
public BaseCommentServiceImpl(BaseCommentRepository<COMMENT> baseCommentRepository,
OptionService optionService,
@ -247,6 +245,10 @@ public abstract class BaseCommentServiceImpl<COMMENT extends BaseComment> extend
comment.setGavatarMd5(DigestUtils.md5Hex(comment.getEmail()));
}
if (StringUtils.isNotEmpty(comment.getAuthorUrl())) {
comment.setAuthorUrl(URLUtil.normalize(comment.getAuthorUrl()));
}
if (authentication != null) {
// Comment of blogger
comment.setIsAdmin(true);

View File

@ -4,6 +4,7 @@ import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.Status;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;
@ -16,6 +17,7 @@ import java.nio.file.Path;
* @author johnniang
* @date 19-5-21
*/
@Ignore
public class GitTest {
private final Path tempPath;

View File

@ -1,6 +1,7 @@
package run.halo.app.utils;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
@ -23,6 +24,7 @@ import java.util.Map;
* @author johnniang
* @date 19-5-21
*/
@Ignore
public class GithubTest {
private final Path tempPath;