mirror of https://github.com/halo-dev/halo
fix: unable to access custom sheet. (#1246)
parent
be5c60083c
commit
17b847082a
|
@ -93,10 +93,6 @@ public class ContentContentController {
|
|||
public String content(@PathVariable("prefix") String prefix,
|
||||
@RequestParam(value = "token", required = false) String token,
|
||||
Model model) {
|
||||
if (optionService.getSheetPermalinkType().equals(SheetPermalinkType.ROOT)) {
|
||||
Sheet sheet = sheetService.getBySlug(prefix);
|
||||
return sheetModel.content(sheet, token, model);
|
||||
}
|
||||
if (optionService.getArchivesPrefix().equals(prefix)) {
|
||||
return postModel.archives(1, model);
|
||||
}
|
||||
|
@ -115,7 +111,11 @@ public class ContentContentController {
|
|||
if (optionService.getLinksPrefix().equals(prefix)) {
|
||||
return linkModel.list(model);
|
||||
}
|
||||
return null;
|
||||
if (optionService.getSheetPermalinkType().equals(SheetPermalinkType.ROOT)) {
|
||||
Sheet sheet = sheetService.getBySlug(prefix);
|
||||
return sheetModel.content(sheet, token, model);
|
||||
}
|
||||
throw new NotFoundException("Not Found");
|
||||
}
|
||||
|
||||
@GetMapping("{prefix}/page/{page:\\d+}")
|
||||
|
@ -155,12 +155,6 @@ public class ContentContentController {
|
|||
}
|
||||
}
|
||||
|
||||
if (optionService.getSheetPermalinkType().equals(SheetPermalinkType.SECONDARY)
|
||||
&& optionService.getSheetPrefix().equals(prefix)) {
|
||||
Sheet sheet = sheetService.getBySlug(slug);
|
||||
return sheetModel.content(sheet, token, model);
|
||||
}
|
||||
|
||||
if (optionService.getCategoriesPrefix().equals(prefix)) {
|
||||
return categoryModel.listPost(model, slug, 1);
|
||||
}
|
||||
|
@ -175,6 +169,12 @@ public class ContentContentController {
|
|||
return postModel.content(post, token, model);
|
||||
}
|
||||
|
||||
if (optionService.getSheetPermalinkType().equals(SheetPermalinkType.SECONDARY)
|
||||
&& optionService.getSheetPrefix().equals(prefix)) {
|
||||
Sheet sheet = sheetService.getBySlug(slug);
|
||||
return sheetModel.content(sheet, token, model);
|
||||
}
|
||||
|
||||
throw new NotFoundException("Not Found");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue