mirror of https://github.com/halo-dev/halo
Add version api for halo application
parent
497aaab67f
commit
e2d8792da4
|
@ -97,7 +97,7 @@ public class HaloConfiguration {
|
|||
OptionService optionService) {
|
||||
ContentFilter contentFilter = new ContentFilter(haloProperties, optionService);
|
||||
contentFilter.setFailureHandler(new ContentAuthenticationFailureHandler());
|
||||
contentFilter.addExcludeUrlPatterns("/api/*", "/install", "/admin/*", "/js/*", "/css/*");
|
||||
contentFilter.addExcludeUrlPatterns("/api/*", "/install", "/version", "/admin/*", "/js/*", "/css/*");
|
||||
|
||||
FilterRegistrationBean<ContentFilter> contentFrb = new FilterRegistrationBean<>();
|
||||
contentFrb.addUrlPatterns("/*");
|
||||
|
|
|
@ -66,4 +66,5 @@ public class AdminController {
|
|||
public AuthToken refresh(@PathVariable("refreshToken") String refreshToken) {
|
||||
return adminService.refreshToken(refreshToken);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package run.halo.app.controller.content.api;
|
||||
package run.halo.app.controller.content;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import run.halo.app.model.support.HaloConst;
|
||||
|
||||
/**
|
||||
* Admin page.
|
||||
|
@ -22,4 +24,10 @@ public class MainController {
|
|||
public String installation() {
|
||||
return "redirect:/admin/index.html#install";
|
||||
}
|
||||
|
||||
@GetMapping("/version")
|
||||
@ResponseBody
|
||||
public String version() {
|
||||
return HaloConst.HALO_VERSION;
|
||||
}
|
||||
}
|
|
@ -76,6 +76,7 @@ public class HaloConst {
|
|||
public static String USER_SESSION_KEY = "user_session";
|
||||
|
||||
static {
|
||||
// Set version
|
||||
HALO_VERSION = HaloConst.class.getPackage().getImplementationVersion();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue