|
@@ -13,6 +13,8 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Aspect
|
|
|
@Component
|
|
@@ -30,10 +32,11 @@ public class AclAspect {
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
String path = request.getServletPath();
|
|
|
|
|
|
- if (path.contains("login") || path.contains("check")) {
|
|
|
+ List<String> allowPath = Arrays.asList("/login","/check", "/admin/leaders/upload");
|
|
|
+ String prefix = path.substring(0, path.replaceAll("\\/\\d+$", "").lastIndexOf("/"));
|
|
|
+ if (allowPath.contains(path)) {
|
|
|
return;
|
|
|
}
|
|
|
- String prefix = path.substring(0, path.replaceAll("\\/\\d+$", "").lastIndexOf("/"));
|
|
|
|
|
|
if(HttpContextUtil.getToken().isPresent() && !roleAclModuleService.getCurrAllowPath().contains(prefix)){
|
|
|
throw new APIException("没有权限");
|