准备springboot打包相关

This commit is contained in:
chenxudong 2025-02-05 10:00:55 +08:00
parent 53e61b11d4
commit 9fae4c420d
3 changed files with 25 additions and 1 deletions

View File

@ -19,6 +19,12 @@
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
@ -93,7 +99,6 @@
<artifactId>aspectjweaver</artifactId>
<version>1.9.7</version>
</dependency>
</dependencies>
<build>

View File

@ -27,12 +27,17 @@ public class WebMvcConfig implements WebMvcConfigurer {
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("index.html")
.addResourceLocations("classpath:/static/");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(loginInterceptor)
.addPathPatterns("/**")
.excludePathPatterns("/index")
.excludePathPatterns("/static/**", "/css/**", "/js/**", "/images/**", "/fonts/**", "/assets/**")
.excludePathPatterns("/data/ed/user/login");
}

View File

@ -0,0 +1,14 @@
package com.electromagnetic.industry.software.manage.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class LoginController {
@GetMapping("index")
public String index() {
return "index";
}
}