Skip to content

Commit 98e7601

Browse files
committed
fix: ui not rendered
1 parent 4c93b8b commit 98e7601

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

boot/src/main/java/com/reajason/javaweb/boot/controller/ViewController.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import jakarta.servlet.http.HttpServletRequest;
44
import jakarta.servlet.http.HttpServletResponse;
5+
import lombok.extern.slf4j.Slf4j;
56
import org.springframework.core.io.ClassPathResource;
67
import org.springframework.http.MediaType;
78
import org.springframework.stereotype.Controller;
@@ -18,6 +19,7 @@
1819
* @since 2024/12/19
1920
*/
2021
@Controller
22+
@Slf4j
2123
public class ViewController {
2224
@GetMapping("/")
2325
public String index(){
@@ -44,7 +46,10 @@ public String handleDataFile(HttpServletRequest request, HttpServletResponse res
4446
@GetMapping("/ui/**")
4547
public String handleHtmlView(HttpServletRequest request) {
4648
String fullPath = request.getRequestURI();
47-
String viewPath = fullPath.substring(3);
49+
if ("/ui".equals(fullPath) || "/ui/".equals(fullPath)) {
50+
return "index";
51+
}
52+
String viewPath = fullPath.substring(4);
4853
return viewPath + "/index";
4954
}
5055

0 commit comments

Comments
 (0)