feat: 升级SpringBoot和SpringCloud版本
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package ui;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ReactUiBootApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ReactUiBootApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package ui.config;
|
||||
|
||||
import ui.properties.UiProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(UiProperties.class)
|
||||
public class StaticResourceConfiguration implements WebMvcConfigurer {
|
||||
|
||||
private final UiProperties uiProperties;
|
||||
|
||||
public StaticResourceConfiguration(UiProperties uiProperties) {
|
||||
this.uiProperties = uiProperties;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
String pathContext = uiProperties.getPathContext();
|
||||
registry.addResourceHandler(pathContext+"/**").addResourceLocations("classpath:/META-INF/central-platform-ui/");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
String pathContext = uiProperties.getPathContext();
|
||||
registry.addViewController(pathContext+"/").setViewName("index.html");
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package ui.properties;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
|
||||
/**
|
||||
* 前端服务配置
|
||||
*
|
||||
* @author zlt
|
||||
* @date 2020/2/3
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@ConfigurationProperties(prefix = "zlt.ui")
|
||||
@RefreshScope
|
||||
public class UiProperties {
|
||||
|
||||
private String pathContext = "/";
|
||||
}
|
||||
Reference in New Issue
Block a user