|
|
@ -20,6 +20,7 @@ import java.time.format.DateTimeFormatter; |
|
|
|
@Slf4j |
|
|
|
public class ModuleAuthenInterceptor implements HandlerInterceptor { |
|
|
|
private MD5 md5 = MD5.create(); |
|
|
|
private Boolean onOff = false; |
|
|
|
public int findThirdOccurrence(String str, char c) { |
|
|
|
int count = 0; |
|
|
|
int index = -1; |
|
|
@ -33,6 +34,7 @@ public class ModuleAuthenInterceptor implements HandlerInterceptor { |
|
|
|
} |
|
|
|
@Override |
|
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
|
|
|
if (onOff){ |
|
|
|
String[] uris = request.getRequestURI().split("admin-api"); |
|
|
|
String uri = uris[uris.length-1]; |
|
|
|
String moduleName = uri.substring(0,findThirdOccurrence(uri,'/')); |
|
|
@ -51,6 +53,7 @@ public class ModuleAuthenInterceptor implements HandlerInterceptor { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|