# springmvc-mybatis-shiro **Repository Path**: jingchu/springmvc-mybatis-shiro ## Basic Information - **Project Name**: springmvc-mybatis-shiro - **Description**: springmvc-mybatis-shiro集成demo - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 9 - **Forks**: 1 - **Created**: 2017-01-16 - **Last Updated**: 2021-01-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 基于Spingmvc+MyBatis+shiro+redis+通用mapper集成的简单DEMO ### 项目框架 - [Spring 4.1.7.RELEASE](http://maven.springframework.org/release/org/springframework/spring/4.1.7.RELEASE/) - [MyBatis 3.2.8](https://github.com/mybatis/mybatis-3) - [Shiro 1.2.3](http://shiro.apache.org/download.html) - [Shiro-redis 2.4.2.1](http://mvnrepository.com/artifact/org.crazycake/shiro-redis/1.0.0-RELEASE) - [通用Mapper](https://github.com/abel533/Mapper) - [前端框架 AdminLTE](https://www.almsaeedstudio.com/themes/AdminLTE/documentation/index.html) ### 开发环境要求 - [JDK 1.8+](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) - [MySQL数据库,我使用的是MySQL 5.7](https://dev.mysql.com/downloads/mysql/) - [Maven 3.3.9](http://maven.apache.org/download.cgi) - IDE 我用的Idea,当然也可以用Eclipse [Idea 下载地址](http://www.jetbrains.com/idea/) - [Tomcat 8+(我用的Tomcat8.5.31)](https://tomcat.apache.org/download-80.cgi) ### 项目使用步骤 1.将doc文件夹中的创建库和建表语句放到MySQL中执行,初始化表结构及基础表数据 2.用Idea创建项目,选择从Git创建,就可以直接将项目导入到Idea中; 如果你是Eclipse工具,也可以先将项目下载到本地,然后导入即可 3.修改数据库连接,如下图:修改db.properties属性文件中数据库连接参数,设置成你自己的即可 ![数据库连接配置](http://git.oschina.net/uploads/images/2017/0118/095033_3967cddb_614740.png "在这里输入图片标题") 4.将项目部署到tomcat中,启动tomcat即可 测试地址:http://localhost:8080/springmvc-mybatis-shiro 测试账号: 用户名 admin 密码 admin123 因为现在只是整合了Shiro登录,还未做权限管理等,功能较少,后期慢慢完善,fighting ### 运行效果 **1.登录页** ![登录页](http://git.oschina.net/uploads/images/2017/0118/095513_885c0c5e_614740.png "登录页") **2.后台首页** ![首页](https://images.gitee.com/uploads/images/2018/0907/152253_8370f3d4_614740.jpeg "1536304933.jpg") **3.无权限访问页** ![无权限访问页](http://git.oschina.net/uploads/images/2017/0118/100145_458a5cea_614740.png "无权限访问页") **4.用户有权访问用户列表页** ![用户列表页](https://images.gitee.com/uploads/images/2018/0906/114352_72def441_614740.png "Q_84O29`J_LVRDM08ZUSKCY.png") ### Session失效后,登录页被Iframe包裹问题解决 ``` - 登录页面中添加 ``` ### 添加Redis作为Shiro Session会话管理器 ![Redis相关配置](https://images.gitee.com/uploads/images/2018/0907/151948_fc8054ec_614740.png "4{G1VS1X]X]~%U]DG{5}K_J.png") ### 附1:通用Mapper链接地址 http://git.oschina.net/free/Mapper/blob/master/wiki/mapper3 ### 附2:分页插件链接地址 https://github.com/pagehelper/Mybatis-PageHelper ### 附3:Generator 链接地址 http://git.oschina.net/free/Mybatis_Utils/blob/master/MybatisGeneator/MybatisGeneator.md 关于redis在此感谢博主:http://blog.sina.com.cn/s/blog_537517170102x5rm.html