|
@ -11,9 +11,6 @@ package com.epmet.commons.tools.aspect; |
|
|
import com.epmet.commons.tools.annotation.RequirePermission; |
|
|
import com.epmet.commons.tools.annotation.RequirePermission; |
|
|
import com.epmet.commons.tools.constant.ThreadLocalConstant; |
|
|
import com.epmet.commons.tools.constant.ThreadLocalConstant; |
|
|
import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO; |
|
|
import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO; |
|
|
import com.epmet.commons.tools.dto.form.LoginUserInfoFormDTO; |
|
|
|
|
|
import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; |
|
|
|
|
|
import com.epmet.commons.tools.dto.form.RoleOpeScopeResultDTO; |
|
|
|
|
|
import com.epmet.commons.tools.enums.RequirePermissionEnum; |
|
|
import com.epmet.commons.tools.enums.RequirePermissionEnum; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
@ -30,11 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.core.annotation.Order; |
|
|
import org.springframework.core.annotation.Order; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import java.util.HashSet; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Set; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 每次请求,过滤Api中配置的权限key出来,并且判断是否具有该功能权限 |
|
|
* 每次请求,过滤Api中配置的权限key出来,并且判断是否具有该功能权限 |
|
|
* @Author wxz |
|
|
* @Author wxz |
|
@ -89,8 +81,9 @@ public class RequirePermissionAspect { |
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
} |
|
|
} |
|
|
Boolean data = result.getData(); |
|
|
Boolean data = result.getData(); |
|
|
|
|
|
|
|
|
if (data == null || !data) { |
|
|
if (data == null || !data) { |
|
|
log.error("操作权限不足"); |
|
|
log.warn("操作权限不足,key:{}", requirePermission); |
|
|
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); |
|
|
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|