pull/1429/head
Ryan Wang 2021-07-18 22:57:23 +08:00 committed by GitHub
parent 1e7d320f1c
commit b554be8165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 22 deletions

View File

@ -45,15 +45,12 @@ import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver;
import run.halo.app.config.properties.HaloProperties;
import run.halo.app.core.PageJacksonSerializer;
import run.halo.app.core.freemarker.inheritance.ThemeExtendsDirective;
import run.halo.app.factory.StringToEnumConverterFactory;
import run.halo.app.model.support.HaloConst;
import run.halo.app.security.resolver.AuthenticationArgumentResolver;
/**
@ -210,23 +207,4 @@ public class HaloMvcConfiguration implements WebMvcConfigurer {
public void addFormatters(FormatterRegistry registry) {
registry.addConverterFactory(new StringToEnumConverterFactory());
}
/**
* Configuring view resolver
*
* @param registry registry
*/
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
FreeMarkerViewResolver resolver = new FreeMarkerViewResolver();
resolver.setAllowRequestOverride(false);
resolver.setCache(false);
resolver.setExposeRequestAttributes(false);
resolver.setExposeSessionAttributes(false);
resolver.setExposeSpringMacroHelpers(true);
resolver.setSuffix(HaloConst.SUFFIX_FTL);
resolver.setContentType("text/html; charset=UTF-8");
registry.viewResolver(resolver);
}
}

View File

@ -41,6 +41,7 @@ spring:
template-loader-path:
- file:///${halo.work-dir}/templates/
- classpath:/templates/
expose-spring-macro-helpers: false
management:
endpoints:
web: