fix: 修改 index.html 路径
This commit is contained in:
@@ -11,6 +11,8 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -37,7 +39,7 @@ public class GUIHistoryRouterFilter extends OncePerRequestFilter {
|
||||
|
||||
if (!matches) {
|
||||
// If the path does not start with any of the specified prefixes, return index.html
|
||||
Resource resource = resourceLoader.getResource("classpath:./public/index.html");
|
||||
Resource resource = resourceLoader.getResource("file:./public/index.html");
|
||||
response.setContentType("text/html");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
Files.copy(resource.getFile().toPath(), response.getOutputStream());
|
||||
|
||||
Reference in New Issue
Block a user