提交 038f9e19 编写于 作者: J johnniang

Complete admin redirection

上级 b2af6dcc
package run.halo.app.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import freemarker.template.TemplateExceptionHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.jackson.JsonComponentModule;
import org.springframework.context.annotation.Bean;
......@@ -78,7 +77,7 @@ public class WebMvcAutoConfiguration implements WebMvcConfigurer {
registry.addResourceHandler("/static/**")
.addResourceLocations("classpath:/static/");
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/templates/themes/")
.addResourceLocations("classpath:/admin/")
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "templates/themes/");
registry.addResourceHandler("/upload/**")
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "upload/");
......@@ -87,7 +86,7 @@ public class WebMvcAutoConfiguration implements WebMvcConfigurer {
registry.addResourceHandler("/backup/**")
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "backup/");
registry.addResourceHandler("/admin/**")
.addResourceLocations("classpath:/static/admin/");
.addResourceLocations("classpath:/admin/");
if (!haloProperties.isDocDisabled()) {
// If doc is enable
......
......@@ -83,4 +83,9 @@ public class ContentIndexController {
model.addAttribute("rainbow", rainbow);
return themeService.render("index");
}
@GetMapping("/admin")
public String admin() {
return "redirect:/admin/index.html";
}
}
<!DOCTYPE html>
<html lang=zh-cmn-Hans>
<head>
<meta charset=utf-8>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel=icon href=/logo.png>
<title>Halo Dashboard</title>
</head>
<body>
<noscript><strong>We're sorry but halo dashboard doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong></noscript>
<div id=app>
Hello, Halo Dashboard!
</div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册