请求路径和白名单管理优化
This commit is contained in:
@@ -59,12 +59,12 @@ public class AuthInterceptor implements HandlerInterceptor {
|
||||
}
|
||||
|
||||
private boolean isWhitelistedPath(String path) {
|
||||
return path.contains("/api/user/login") ||
|
||||
path.contains("/api/user/register") ||
|
||||
path.contains("/api/user/refresh-token") ||
|
||||
path.contains("/api/shop/list/simple") ||
|
||||
path.contains("/api/admin/auth/login") ||
|
||||
path.contains("/api/admin/object-storage-file/upload") ||
|
||||
return path.contains("/user/login") ||
|
||||
path.contains("/user/register") ||
|
||||
path.contains("/user/refresh-token") ||
|
||||
path.contains("/shop/list/simple") ||
|
||||
path.contains("/admin/auth/login") ||
|
||||
path.contains("/admin/object-storage-file/upload") ||
|
||||
path.contains("/health");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/auth")
|
||||
@RequestMapping("/admin/auth")
|
||||
@RequiredArgsConstructor
|
||||
public class AdminAuthController {
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/permission")
|
||||
@RequestMapping("/admin/permission")
|
||||
@RequiredArgsConstructor
|
||||
public class AdminPermissionController {
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/product")
|
||||
@RequestMapping("/admin/product")
|
||||
@RequiredArgsConstructor
|
||||
public class AdminProductController {
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/shops")
|
||||
@RequestMapping("/admin/shops")
|
||||
@RequiredArgsConstructor
|
||||
public class AdminShopController {
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/user")
|
||||
@RequestMapping("/admin/user")
|
||||
@RequiredArgsConstructor
|
||||
public class AdminUserController {
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/dashboard")
|
||||
@RequestMapping("/admin/dashboard")
|
||||
@RequiredArgsConstructor
|
||||
public class DashboardController {
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 提供前台用户可以访问的文件相关接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/file")
|
||||
@RequestMapping("/file")
|
||||
@RequiredArgsConstructor
|
||||
public class FrontendFileController {
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import java.util.UUID;
|
||||
* @date 2026-02-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/object-storage-file")
|
||||
@RequestMapping("/admin/object-storage-file")
|
||||
@RequiredArgsConstructor
|
||||
public class ObjectStorageFileController {
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/product")
|
||||
@RequestMapping("/product")
|
||||
@RequiredArgsConstructor
|
||||
public class ProductController {
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/shop")
|
||||
@RequestMapping("/shop")
|
||||
@RequiredArgsConstructor
|
||||
public class ShopController {
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import java.util.UUID;
|
||||
* @date 2026-02-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/user")
|
||||
@RequestMapping("/user")
|
||||
@RequiredArgsConstructor
|
||||
public class UserController {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user