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 VOLUME /tmp

View File

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

View File

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

View File

@ -192,7 +192,7 @@ public class AdminServiceImpl implements AdminService {
Assert.hasText(refreshToken, "Refresh token must not be blank"); Assert.hasText(refreshToken, "Refresh token must not be blank");
Integer userId = cacheStore.getAny(SecurityUtils.buildTokenRefreshKey(refreshToken), Integer.class) 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 // Get user info
User user = userService.getById(userId); User user = userService.getById(userId);

View File

@ -1,5 +1,6 @@
package run.halo.app.service.impl; package run.halo.app.service.impl;
import cn.hutool.core.util.URLUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -55,13 +56,10 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public abstract class BaseCommentServiceImpl<COMMENT extends BaseComment> extends AbstractCrudService<COMMENT, Long> implements BaseCommentService<COMMENT> { 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 OptionService optionService;
protected final UserService userService; protected final UserService userService;
protected final ApplicationEventPublisher eventPublisher; protected final ApplicationEventPublisher eventPublisher;
private final BaseCommentRepository<COMMENT> baseCommentRepository;
public BaseCommentServiceImpl(BaseCommentRepository<COMMENT> baseCommentRepository, public BaseCommentServiceImpl(BaseCommentRepository<COMMENT> baseCommentRepository,
OptionService optionService, OptionService optionService,
@ -247,6 +245,10 @@ public abstract class BaseCommentServiceImpl<COMMENT extends BaseComment> extend
comment.setGavatarMd5(DigestUtils.md5Hex(comment.getEmail())); comment.setGavatarMd5(DigestUtils.md5Hex(comment.getEmail()));
} }
if (StringUtils.isNotEmpty(comment.getAuthorUrl())) {
comment.setAuthorUrl(URLUtil.normalize(comment.getAuthorUrl()));
}
if (authentication != null) { if (authentication != null) {
// Comment of blogger // Comment of blogger
comment.setIsAdmin(true); 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.Status;
import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import java.io.IOException; import java.io.IOException;
@ -16,6 +17,7 @@ import java.nio.file.Path;
* @author johnniang * @author johnniang
* @date 19-5-21 * @date 19-5-21
*/ */
@Ignore
public class GitTest { public class GitTest {
private final Path tempPath; private final Path tempPath;

View File

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