附表结构)"/>
微服务springBoot,AOP实现菜单管理权限(附表结构)
权限注解:
@Target({ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface CheckPermissions {String value() default "";
}
切入点:
@Aspect
@Component
public class CheckPermissionsAspect extends BaseController {@Autowiredprivate OrgMenuService menuService;@Autowiredprivate OrgEmpRoleService empRoleService;@Autowiredprivate OrgRoleMenuService roleMenuService;@Autowiredprivate OrgEmpService empService;@Pointcut("@annotation(com.bcl.yiliao.annotation.CheckPermissions)")public void CheckPermissionsAspect() {}@Before("CheckPermissionsAspect()")public void doBefore(JoinPoint joinpoint) throws Throwable {//获取用户的IDLong userId = getCurrentUserId();if(userId == 0){
更多推荐
微服务springBoot,AOP实现菜单管理权限(附表结构)
发布评论