mirror of https://github.com/halo-dev/halo
Complete admin redirection
parent
b2af6dcc0a
commit
038f9e197e
|
@ -1,7 +1,6 @@
|
||||||
package run.halo.app.config;
|
package run.halo.app.config;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import freemarker.template.TemplateExceptionHandler;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.jackson.JsonComponentModule;
|
import org.springframework.boot.jackson.JsonComponentModule;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
@ -78,7 +77,7 @@ public class WebMvcAutoConfiguration implements WebMvcConfigurer {
|
||||||
registry.addResourceHandler("/static/**")
|
registry.addResourceHandler("/static/**")
|
||||||
.addResourceLocations("classpath:/static/");
|
.addResourceLocations("classpath:/static/");
|
||||||
registry.addResourceHandler("/**")
|
registry.addResourceHandler("/**")
|
||||||
.addResourceLocations("classpath:/templates/themes/")
|
.addResourceLocations("classpath:/admin/")
|
||||||
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "templates/themes/");
|
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "templates/themes/");
|
||||||
registry.addResourceHandler("/upload/**")
|
registry.addResourceHandler("/upload/**")
|
||||||
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "upload/");
|
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "upload/");
|
||||||
|
@ -87,7 +86,7 @@ public class WebMvcAutoConfiguration implements WebMvcConfigurer {
|
||||||
registry.addResourceHandler("/backup/**")
|
registry.addResourceHandler("/backup/**")
|
||||||
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "backup/");
|
.addResourceLocations(FILE_PROTOCOL + haloProperties.getWorkDir() + "backup/");
|
||||||
registry.addResourceHandler("/admin/**")
|
registry.addResourceHandler("/admin/**")
|
||||||
.addResourceLocations("classpath:/static/admin/");
|
.addResourceLocations("classpath:/admin/");
|
||||||
|
|
||||||
if (!haloProperties.isDocDisabled()) {
|
if (!haloProperties.isDocDisabled()) {
|
||||||
// If doc is enable
|
// If doc is enable
|
||||||
|
|
|
@ -83,4 +83,9 @@ public class ContentIndexController {
|
||||||
model.addAttribute("rainbow", rainbow);
|
model.addAttribute("rainbow", rainbow);
|
||||||
return themeService.render("index");
|
return themeService.render("index");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/admin")
|
||||||
|
public String admin() {
|
||||||
|
return "redirect:/admin/index.html";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<!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>
|
Loading…
Reference in New Issue