mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-08 02:04:04 +08:00
移除Minio的pre-sign-url的限流
This commit is contained in:
parent
1d31045807
commit
95e2652615
@ -30,6 +30,13 @@ public class BackendConstant {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static final List<String> API_LIMIT_WHITELIST =
|
||||||
|
new ArrayList<>() {
|
||||||
|
{
|
||||||
|
add("/backend/v1/upload/minio/pre-sign-url");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public static final String RESOURCE_TYPE_VIDEO = "VIDEO";
|
public static final String RESOURCE_TYPE_VIDEO = "VIDEO";
|
||||||
public static final String RESOURCE_TYPE_IMAGE = "IMAGE";
|
public static final String RESOURCE_TYPE_IMAGE = "IMAGE";
|
||||||
public static final String RESOURCE_TYPE_PDF = "PDF";
|
public static final String RESOURCE_TYPE_PDF = "PDF";
|
||||||
|
@ -26,6 +26,7 @@ import org.springframework.web.servlet.HandlerInterceptor;
|
|||||||
|
|
||||||
import xyz.playedu.common.bus.BackendBus;
|
import xyz.playedu.common.bus.BackendBus;
|
||||||
import xyz.playedu.common.config.PlayEduConfig;
|
import xyz.playedu.common.config.PlayEduConfig;
|
||||||
|
import xyz.playedu.common.constant.BackendConstant;
|
||||||
import xyz.playedu.common.context.BCtx;
|
import xyz.playedu.common.context.BCtx;
|
||||||
import xyz.playedu.common.domain.AdminUser;
|
import xyz.playedu.common.domain.AdminUser;
|
||||||
import xyz.playedu.common.service.AdminUserService;
|
import xyz.playedu.common.service.AdminUserService;
|
||||||
@ -59,7 +60,11 @@ public class AdminInterceptor implements HandlerInterceptor {
|
|||||||
public boolean preHandle(
|
public boolean preHandle(
|
||||||
HttpServletRequest request, HttpServletResponse response, Object handler)
|
HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
if ("OPTIONS".equals(request.getMethod())) {
|
// 当前api的请求路径
|
||||||
|
String path = request.getRequestURI();
|
||||||
|
// 白名单过滤
|
||||||
|
if (BackendConstant.API_LIMIT_WHITELIST.contains(path)
|
||||||
|
|| "OPTIONS".equals(request.getMethod())) {
|
||||||
return HandlerInterceptor.super.preHandle(request, response, handler);
|
return HandlerInterceptor.super.preHandle(request, response, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user