shiro

倖福魔咒の 提交于 2019-11-28 02:41:30

1.所需要jar包
    <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-parent</artifactId>
                    <version>1.5.22.RELEASE</version>
                </dependency>
                <!--
                    springboot-starter-web
                -->
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                    <version>1.5.22.RELEASE</version>
                </dependency>
                <!--
                    springboot-mybatis整合包
                -->
                <dependency>
                    <groupId>org.mybatis.spring.boot</groupId>
                    <artifactId>mybatis-spring-boot-starter</artifactId>
                    <version>1.3.0</version>
                </dependency>
                <!--
                    mysql的驱动包
                -->
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <version>5.1.38</version>
                </dependency>
                <!--
                    druid连接池
                -->
                <dependency>
                    <groupId>com.alibaba</groupId>
                    <artifactId>druid</artifactId>
                    <version>1.1.10</version>
                </dependency>
                <!--
                    html的thymeleaf模板
                -->
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-thymeleaf</artifactId>
                    <version>1.5.10.RELEASE</version>
                </dependency>
                <!--
                    fastjson包
                -->
                <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                    <version>2.8.1</version>
                </dependency>
                <!--
                    添加springboot的进程jar包
                        里面包含了properties文件的读取(其实就是包含了@ConfigurationProperties()注解)
                -->
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-configuration-processor</artifactId>
                    <version>1.5.22.RELEASE</version>
                    <optional>true</optional>
                </dependency>
                <!--
                    shiro和each的缓存包
                -->
                <dependency>
                    <groupId>org.apache.shiro</groupId>
                    <artifactId>shiro-ehcache</artifactId>
                    <version>1.2.5</version>
                </dependency>
                <!--
                    shiro和springboot的整合包
                -->
                <dependency>
                    <groupId>org.apache.shiro</groupId>
                    <artifactId>shiro-spring</artifactId>
                    <version>1.2.5</version>
                </dependency>
                <!--
                    在thymeleaf模板中使用shiro的标签
                -->
                <dependency>
                    <groupId>com.github.theborakompanioni</groupId>
                    <artifactId>thymeleaf-extras-shiro</artifactId>
                    <version>1.2.1</version>
                </dependency>

                <dependency>
                    <groupId>net.sourceforge.nekohtml</groupId>
                    <artifactId>nekohtml</artifactId>
                    <version>1.9.21</version>
                </dependency>
            </dependencies>

2.实现层级依赖
    shiro-model:不需要依赖任何项目
    shiro-mapper:依赖于model
    shiro-service:依赖于mapper
    shiro-web:依赖于service,依赖于kernel
    shiro-kernel:依赖于service

3.需求
    当认证成功后会自动跳转到项目的根目录"/"
    index页面有菜单
        图书管理
        学生管理
        用户管理
        垃圾分类管理
    根据当前所登录的用户所拥有的角色来进行显示菜单
        user--->user_manager--->只会显示用户管理,其他菜单不显示

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!