Fixed sheet render error.

pull/146/head
ruibaby 2019-04-30 11:49:28 +08:00
parent 297dafc34f
commit 03b7c33297
1 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import run.halo.app.model.entity.Sheet;
import run.halo.app.model.enums.PostStatus;
import run.halo.app.model.support.HaloConst;
import run.halo.app.service.SheetService;
import run.halo.app.service.ThemeService;
@ -65,7 +66,9 @@ public class ContentSheetController {
model.addAttribute("sheet", sheetService.convertToDetail(sheet));
if (StrUtil.isNotEmpty(sheet.getTemplate())) {
return themeService.render(sheet.getTemplate());
if (themeService.isTemplateExist(sheet.getTemplate() + HaloConst.SUFFIX_FTL)) {
return themeService.render(sheet.getTemplate());
}
}
return themeService.render("sheet");
}