feat: 收口知识库分享链路
- 新增 shareKey 单参数 URL 分享页与失效页 - 新增知识库分享后端鉴权、审计与迁移脚本 - 在访问令牌中增加知识库分享授权入口
This commit is contained in:
@@ -21,9 +21,20 @@ public class CurdInterceptor implements HandlerInterceptor {
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
String requestURI = request.getRequestURI();
|
||||
String contextPath = request.getContextPath();
|
||||
String normalizedRequestUri = requestURI;
|
||||
if (StrUtil.isNotBlank(contextPath) && StrUtil.startWith(requestURI, contextPath)) {
|
||||
normalizedRequestUri = requestURI.substring(contextPath.length());
|
||||
}
|
||||
|
||||
log.info("进入 CurdInterceptor requestURI:{}", requestURI);
|
||||
|
||||
// 分享访问接口与公开 API 走各自的业务鉴权,不走后台通用 CRUD 权限码拦截。
|
||||
if (StrUtil.startWith(normalizedRequestUri, "/api/v1/share/")
|
||||
|| StrUtil.startWith(normalizedRequestUri, "/public-api/")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String groupName = "";
|
||||
// 检查handler是否是HandlerMethod类型
|
||||
if (handler instanceof HandlerMethod) {
|
||||
|
||||
Reference in New Issue
Block a user