访问域名时跳转到/index

This commit is contained in:
chuzhongzai 2024-06-02 22:41:22 +08:00
parent 78747c60eb
commit 27ceed8f4a
2 changed files with 11 additions and 1 deletions

View File

@ -30,8 +30,13 @@ public class PersonalController {
this.localService = localService; this.localService = localService;
} }
@GetMapping("/")
public void index(HttpServletResponse resp) throws IOException {
resp.sendRedirect("/index");
}
@GetMapping("/files") @GetMapping("/files")
public String file(String path) throws IOException { public String file(String path){
return personalService.getFiles(path); return personalService.getFiles(path);
} }

View File

@ -38,6 +38,11 @@ public class PublicController {
this.queryService = queryService; this.queryService = queryService;
} }
@GetMapping("/")
public void index(HttpServletResponse resp) throws IOException {
resp.sendRedirect("/index");
}
@GetMapping("/ip") @GetMapping("/ip")
public void ip(HttpServletRequest request, String auth, HttpServletResponse response) throws IOException { public void ip(HttpServletRequest request, String auth, HttpServletResponse response) throws IOException {
String ip = request.getHeader("X-Forwarded-For"); String ip = request.getHeader("X-Forwarded-For");