问答详情
源自:3-2 Shiro授权

演示代码的github地址有吗

演示代码的github地址有吗

提问者:Robin_0028 2018-04-24 11:18

个回答

  • qq_雨巷無香_lryEHS
    2019-08-21 22:42:05

    https://github.com/chengchenrui/shiro-security

  • 苏墨琴苍
    2018-06-12 08:01:54

    //1.创建securityManager环境
    DefaultSecurityManager defaultSecurityManager = new DefaultSecurityManager();
    defaultSecurityManager.setRealm(accountRealm);
    //2.主体提交认证
    SecurityUtils.setSecurityManager(defaultSecurityManager);
    Subject subject = SecurityUtils.getSubject();
    UsernamePasswordToken token = new UsernamePasswordToken("Mark","123456");
    subject.login(token);
    subject.checkRole("admin");
    System.out.print("isAuthenticated:"+subject.isAuthenticated());
    subject.logout();


  • s2mple
    2018-04-26 11:18:38

    没有的