mirror of https://github.com/halo-dev/halo
Fixed 404 or 500 page rendered error.
parent
de6d3d29b9
commit
caee1f77a3
|
@ -63,4 +63,12 @@ public class MainController {
|
||||||
response.sendRedirect(blogLogo);
|
response.sendRedirect(blogLogo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/favicon.ico")
|
||||||
|
public void favicon(HttpServletResponse response) throws IOException {
|
||||||
|
String favicon = optionService.getByProperty(BlogProperties.BLOG_FAVICON).orElse("").toString();
|
||||||
|
if (StringUtils.isNotEmpty(favicon)) {
|
||||||
|
response.sendRedirect(favicon);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class CommonController implements ErrorController {
|
||||||
return "common/error/404";
|
return "common/error/404";
|
||||||
}
|
}
|
||||||
StrBuilder path = new StrBuilder("themes/");
|
StrBuilder path = new StrBuilder("themes/");
|
||||||
path.append(themeService.getActivatedThemeId());
|
path.append(themeService.getActivatedTheme().getFolderName());
|
||||||
path.append("/404");
|
path.append("/404");
|
||||||
return path.toString();
|
return path.toString();
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public class CommonController implements ErrorController {
|
||||||
return "common/error/500";
|
return "common/error/500";
|
||||||
}
|
}
|
||||||
StrBuilder path = new StrBuilder("themes/");
|
StrBuilder path = new StrBuilder("themes/");
|
||||||
path.append(themeService.getActivatedThemeId());
|
path.append(themeService.getActivatedTheme().getFolderName());
|
||||||
path.append("/500");
|
path.append("/500");
|
||||||
return path.toString();
|
return path.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,7 @@
|
||||||
|
|
||||||
<#-- favicon -->
|
<#-- favicon -->
|
||||||
<#macro favicon>
|
<#macro favicon>
|
||||||
<#if options.blog_favicon??>
|
<link rel="shortcut icon" type="images/x-icon" href="${options.blog_favicon!}">
|
||||||
<link rel="shortcut icon" type="images/x-icon" href="${options.blog_favicon}">
|
|
||||||
</#if>
|
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#-- 站点验证代码 -->
|
<#-- 站点验证代码 -->
|
||||||
|
|
Loading…
Reference in New Issue