微服务springBoot,AOP实现菜单管理权限(附表结构)

编程入门 行业动态 更新时间:2024-10-26 00:28:05

微服务springBoot,AOP实现菜单管理权限(<a href=https://www.elefans.com/category/jswz/34/1712939.html style=附表结构)"/>

微服务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实现菜单管理权限(附表结构)

本文发布于:2024-02-12 21:13:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1689418.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:附表   管理权限   菜单   结构   springBoot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!