├── layui-admin-web ├── src │ └── main │ │ ├── webapp │ │ ├── .gitignore │ │ ├── static │ │ │ ├── images │ │ │ │ ├── face.jpg │ │ │ │ ├── alipay.jpg │ │ │ │ ├── wechat.jpg │ │ │ │ ├── userface1.jpg │ │ │ │ ├── userface2.jpg │ │ │ │ ├── userface3.jpg │ │ │ │ ├── userface4.jpg │ │ │ │ └── userface5.jpg │ │ │ ├── layui │ │ │ │ ├── font │ │ │ │ │ ├── iconfont.eot │ │ │ │ │ ├── iconfont.ttf │ │ │ │ │ └── iconfont.woff │ │ │ │ ├── images │ │ │ │ │ └── face │ │ │ │ │ │ ├── 0.gif │ │ │ │ │ │ ├── 1.gif │ │ │ │ │ │ ├── 2.gif │ │ │ │ │ │ ├── 3.gif │ │ │ │ │ │ ├── 4.gif │ │ │ │ │ │ ├── 5.gif │ │ │ │ │ │ ├── 6.gif │ │ │ │ │ │ ├── 7.gif │ │ │ │ │ │ ├── 8.gif │ │ │ │ │ │ ├── 9.gif │ │ │ │ │ │ ├── 10.gif │ │ │ │ │ │ ├── 11.gif │ │ │ │ │ │ ├── 12.gif │ │ │ │ │ │ ├── 13.gif │ │ │ │ │ │ ├── 14.gif │ │ │ │ │ │ ├── 15.gif │ │ │ │ │ │ ├── 16.gif │ │ │ │ │ │ ├── 17.gif │ │ │ │ │ │ ├── 18.gif │ │ │ │ │ │ ├── 19.gif │ │ │ │ │ │ ├── 20.gif │ │ │ │ │ │ ├── 21.gif │ │ │ │ │ │ ├── 22.gif │ │ │ │ │ │ ├── 23.gif │ │ │ │ │ │ ├── 24.gif │ │ │ │ │ │ ├── 25.gif │ │ │ │ │ │ ├── 26.gif │ │ │ │ │ │ ├── 27.gif │ │ │ │ │ │ ├── 28.gif │ │ │ │ │ │ ├── 29.gif │ │ │ │ │ │ ├── 30.gif │ │ │ │ │ │ ├── 31.gif │ │ │ │ │ │ ├── 32.gif │ │ │ │ │ │ ├── 33.gif │ │ │ │ │ │ ├── 34.gif │ │ │ │ │ │ ├── 35.gif │ │ │ │ │ │ ├── 36.gif │ │ │ │ │ │ ├── 37.gif │ │ │ │ │ │ ├── 38.gif │ │ │ │ │ │ ├── 39.gif │ │ │ │ │ │ ├── 40.gif │ │ │ │ │ │ ├── 41.gif │ │ │ │ │ │ ├── 42.gif │ │ │ │ │ │ ├── 43.gif │ │ │ │ │ │ ├── 44.gif │ │ │ │ │ │ ├── 45.gif │ │ │ │ │ │ ├── 46.gif │ │ │ │ │ │ ├── 47.gif │ │ │ │ │ │ ├── 48.gif │ │ │ │ │ │ ├── 49.gif │ │ │ │ │ │ ├── 50.gif │ │ │ │ │ │ ├── 51.gif │ │ │ │ │ │ ├── 52.gif │ │ │ │ │ │ ├── 53.gif │ │ │ │ │ │ ├── 54.gif │ │ │ │ │ │ ├── 55.gif │ │ │ │ │ │ ├── 56.gif │ │ │ │ │ │ ├── 57.gif │ │ │ │ │ │ ├── 58.gif │ │ │ │ │ │ ├── 59.gif │ │ │ │ │ │ ├── 60.gif │ │ │ │ │ │ ├── 61.gif │ │ │ │ │ │ ├── 62.gif │ │ │ │ │ │ ├── 63.gif │ │ │ │ │ │ ├── 64.gif │ │ │ │ │ │ ├── 65.gif │ │ │ │ │ │ ├── 66.gif │ │ │ │ │ │ ├── 67.gif │ │ │ │ │ │ ├── 68.gif │ │ │ │ │ │ ├── 69.gif │ │ │ │ │ │ ├── 70.gif │ │ │ │ │ │ └── 71.gif │ │ │ │ ├── css │ │ │ │ │ └── modules │ │ │ │ │ │ ├── laydate │ │ │ │ │ │ └── icon.png │ │ │ │ │ │ ├── layer │ │ │ │ │ │ └── default │ │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ │ │ └── loading-2.gif │ │ │ │ │ │ └── code.css │ │ │ │ └── lay │ │ │ │ │ └── modules │ │ │ │ │ ├── util.js │ │ │ │ │ ├── code.js │ │ │ │ │ ├── laytpl.js │ │ │ │ │ ├── flow.js │ │ │ │ │ ├── upload.js │ │ │ │ │ ├── tree.js │ │ │ │ │ └── laypage.js │ │ │ ├── plugin │ │ │ │ └── ztree │ │ │ │ │ └── css │ │ │ │ │ ├── metroStyle │ │ │ │ │ └── img │ │ │ │ │ │ ├── metro.gif │ │ │ │ │ │ ├── metro.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ └── line_conn.png │ │ │ │ │ ├── zTreeStyle │ │ │ │ │ └── img │ │ │ │ │ │ ├── diy │ │ │ │ │ │ ├── 2.png │ │ │ │ │ │ ├── 3.png │ │ │ │ │ │ ├── 4.png │ │ │ │ │ │ ├── 5.png │ │ │ │ │ │ ├── 6.png │ │ │ │ │ │ ├── 7.png │ │ │ │ │ │ ├── 8.png │ │ │ │ │ │ ├── 9.png │ │ │ │ │ │ ├── 1_open.png │ │ │ │ │ │ └── 1_close.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ │ └── zTreeStandard.png │ │ │ │ │ └── awesomeStyle │ │ │ │ │ └── img │ │ │ │ │ └── loading.gif │ │ │ ├── json │ │ │ │ ├── userface.json │ │ │ │ ├── systemParameter.json │ │ │ │ ├── linksList.json │ │ │ │ ├── usersList.json │ │ │ │ ├── message.json │ │ │ │ ├── menu.json │ │ │ │ └── images.json │ │ │ ├── css │ │ │ │ ├── base.css │ │ │ │ └── login.css │ │ │ └── js │ │ │ │ ├── jqmodules │ │ │ │ └── jqdate.js │ │ │ │ ├── nav.js │ │ │ │ ├── list.js │ │ │ │ ├── myform.js │ │ │ │ ├── leftNav.js │ │ │ │ ├── index.js │ │ │ │ └── main.js │ │ └── WEB-INF │ │ │ ├── views │ │ │ ├── error │ │ │ │ ├── illegalAccess.html │ │ │ │ └── 404.html │ │ │ ├── common │ │ │ │ ├── version.html │ │ │ │ └── header.html │ │ │ ├── role │ │ │ │ ├── add.html │ │ │ │ ├── edit.html │ │ │ │ ├── auth.html │ │ │ │ └── list.html │ │ │ ├── log │ │ │ │ └── list.html │ │ │ ├── menu │ │ │ │ ├── add.html │ │ │ │ ├── edit.html │ │ │ │ ├── add_item.html │ │ │ │ ├── edit_item.html │ │ │ │ └── list.html │ │ │ ├── user │ │ │ │ ├── add.html │ │ │ │ ├── edit.html │ │ │ │ └── list.html │ │ │ ├── index.html │ │ │ └── pages │ │ │ │ └── main.html │ │ │ └── web.xml │ │ ├── resources │ │ ├── properties │ │ │ └── jdbc.properties │ │ ├── log4j.properties │ │ ├── xml │ │ │ └── mybatis-config.xml │ │ └── spring │ │ │ └── applicationContext-service.xml │ │ └── java │ │ └── org │ │ └── alex │ │ └── admin │ │ └── web │ │ ├── mapper │ │ ├── SysLogMapper.java │ │ ├── SysRoleMapper.java │ │ ├── SysUserMapper.java │ │ ├── SysSettingMapper.java │ │ ├── SysUserRoleMapper.java │ │ ├── xml │ │ │ ├── SysUserRoleMapper.xml │ │ │ ├── SysRoleMapper.xml │ │ │ ├── SysSettingMapper.xml │ │ │ ├── SysUserMapper.xml │ │ │ ├── SysLogMapper.xml │ │ │ ├── SysRoleMenuMapper.xml │ │ │ └── SysMenuMapper.xml │ │ ├── SysRoleMenuMapper.java │ │ └── SysMenuMapper.java │ │ ├── service │ │ ├── ISysLogService.java │ │ ├── ISysRoleService.java │ │ ├── ISysSettingService.java │ │ ├── ISysUserRoleService.java │ │ ├── ISysRoleMenuService.java │ │ ├── impl │ │ │ ├── SysRoleServiceImpl.java │ │ │ ├── SysSettingServiceImpl.java │ │ │ ├── SysUserRoleServiceImpl.java │ │ │ ├── SysRoleMenuServiceImpl.java │ │ │ ├── SysLogServiceImpl.java │ │ │ ├── SysMenuServiceImpl.java │ │ │ └── SysUserServiceImpl.java │ │ ├── ISysUserService.java │ │ └── ISysMenuService.java │ │ ├── component │ │ ├── RestExceptionAdvice.java │ │ └── SwaggerConfig.java │ │ ├── controller │ │ ├── ErrorController.java │ │ ├── IndexController.java │ │ ├── CommonController.java │ │ ├── LoginController.java │ │ ├── LogController.java │ │ └── FileUploadController.java │ │ ├── entity │ │ ├── SysRoleMenu.java │ │ ├── SysUserRole.java │ │ ├── SysRole.java │ │ ├── SysSetting.java │ │ ├── SysMenu.java │ │ ├── SysUser.java │ │ └── SysLog.java │ │ ├── interceptor │ │ ├── LoginInterceptor.java │ │ └── ResourceInterceptor.java │ │ └── util │ │ └── BaseUtil.java └── pom.xml ├── imgs ├── 1.png ├── 2.png ├── 3.png └── 4.png ├── layui-admin-core └── src │ └── main │ └── java │ └── org │ └── alex │ └── admin │ └── core │ ├── log │ ├── LogApi.java │ ├── LogAdvice.java │ └── LogBean.java │ ├── anno │ ├── Resource.java │ ├── PassLogin.java │ ├── ForbidMethod.java │ └── Log.java │ ├── jsonp │ └── JsonpSupportAdvice.java │ ├── ex │ ├── ForbidAccessException.java │ └── NotFindDataException.java │ ├── jackson │ └── CustomObjectMapper.java │ ├── advice │ └── ForbidMethodAdvice.java │ ├── controller │ └── CrudController.java │ ├── util │ └── IpUtil.java │ └── bean │ └── Rest.java └── README.md /layui-admin-web/src/main/webapp/.gitignore: -------------------------------------------------------------------------------- 1 | /upload/ 2 | -------------------------------------------------------------------------------- /imgs/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/imgs/1.png -------------------------------------------------------------------------------- /imgs/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/imgs/2.png -------------------------------------------------------------------------------- /imgs/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/imgs/3.png -------------------------------------------------------------------------------- /imgs/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/imgs/4.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/images/face.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/images/face.jpg -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/images/alipay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/images/alipay.jpg -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/images/wechat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/images/wechat.jpg -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/images/userface1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/images/userface1.jpg -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/images/userface2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/images/userface2.jpg -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/images/userface3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/images/userface3.jpg -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/images/userface4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/images/userface4.jpg -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/images/userface5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/images/userface5.jpg -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/font/iconfont.eot -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/0.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/1.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/2.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/3.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/4.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/5.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/6.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/7.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/8.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/9.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/font/iconfont.woff -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/10.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/11.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/12.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/13.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/14.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/15.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/16.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/17.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/18.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/19.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/20.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/21.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/22.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/23.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/24.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/25.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/26.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/27.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/28.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/29.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/30.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/31.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/32.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/33.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/34.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/35.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/36.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/37.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/38.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/39.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/40.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/41.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/42.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/43.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/44.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/45.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/46.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/47.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/48.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/49.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/50.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/51.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/52.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/53.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/54.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/55.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/56.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/57.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/58.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/59.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/60.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/61.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/62.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/63.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/64.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/65.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/66.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/67.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/68.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/69.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/70.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/images/face/71.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/css/modules/laydate/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/css/modules/laydate/icon.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/metroStyle/img/metro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/metroStyle/img/metro.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/metroStyle/img/metro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/metroStyle/img/metro.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/2.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/3.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/4.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/5.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/6.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/7.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/8.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/9.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/error/illegalAccess.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

无权限访问.

7 |

${url} 8 |


9 | 10 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/metroStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/metroStyle/img/loading.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/loading.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/awesomeStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/awesomeStyle/img/loading.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/metroStyle/img/line_conn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/metroStyle/img/line_conn.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/1_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/1_open.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/line_conn.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/1_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/diy/1_close.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/zTreeStandard.gif -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/telzhou618/layui-admin/HEAD/layui-admin-web/src/main/webapp/static/plugin/ztree/css/zTreeStyle/img/zTreeStandard.png -------------------------------------------------------------------------------- /layui-admin-web/src/main/resources/properties/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driver=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://127.0.0.1:3306/layui-admin?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull 3 | jdbc.username=root 4 | jdbc.password=root 5 | validationQuery=SELECT 1 -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/log/LogApi.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.log; 2 | 3 | /** 4 | * 记录日志接口 5 | * Created by Gaojun.Zhou 2017年6月20日 6 | */ 7 | public interface LogApi { 8 | 9 | /** 10 | * 记录日志 11 | * @param log 12 | */ 13 | void log(LogBean log); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/SysLogMapper.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.mapper; 2 | 3 | import org.alex.admin.web.entity.SysLog; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 日志表 Mapper 接口 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-07-06 13 | */ 14 | public interface SysLogMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/SysRoleMapper.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.mapper; 2 | 3 | import org.alex.admin.web.entity.SysRole; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 角色表 Mapper 接口 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface SysRoleMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/SysUserMapper.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.mapper; 2 | 3 | import org.alex.admin.web.entity.SysUser; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 用户表 Mapper 接口 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface SysUserMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/ISysLogService.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service; 2 | 3 | import org.alex.admin.web.entity.SysLog; 4 | import com.baomidou.mybatisplus.service.IService; 5 | 6 | /** 7 | *

8 | * 日志表 服务类 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface ISysLogService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/ISysRoleService.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service; 2 | 3 | import org.alex.admin.web.entity.SysRole; 4 | import com.baomidou.mybatisplus.service.IService; 5 | 6 | /** 7 | *

8 | * 角色表 服务类 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface ISysRoleService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/SysSettingMapper.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.mapper; 2 | 3 | import org.alex.admin.web.entity.SysSetting; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 系统设置表 Mapper 接口 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface SysSettingMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/SysUserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.mapper; 2 | 3 | import org.alex.admin.web.entity.SysUserRole; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * 用户角色关联表 Mapper 接口 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface SysUserRoleMapper extends BaseMapper { 15 | 16 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/ISysSettingService.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service; 2 | 3 | import org.alex.admin.web.entity.SysSetting; 4 | import com.baomidou.mybatisplus.service.IService; 5 | 6 | /** 7 | *

8 | * 系统设置表 服务类 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface ISysSettingService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/ISysUserRoleService.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service; 2 | 3 | import org.alex.admin.web.entity.SysUserRole; 4 | import com.baomidou.mybatisplus.service.IService; 5 | 6 | /** 7 | *

8 | * 用户角色关联表 服务类 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface ISysUserRoleService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
8 | 9 |

我勒个去,页面被外星人挟持了!

10 |
11 | 12 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/json/userface.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": 0, 3 | "msg": "", 4 | "data": [ 5 | { 6 | "src": "../../images/userface1.jpg" 7 | },{ 8 | "src": "../../images/userface2.jpg" 9 | },{ 10 | "src": "../../images/userface3.jpg" 11 | },{ 12 | "src": "../../images/userface4.jpg" 13 | },{ 14 | "src": "../../images/userface5.jpg" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/json/systemParameter.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmsName": "layui后台管理模版", 3 | "version": "v1.0.0", 4 | "author": "请叫我马哥", 5 | "homePage": "page/index.html", 6 | "server": "windows", 7 | "dataBase": "8.00.2039", 8 | "maxUpload": "2M", 9 | "userRights": "总管理员", 10 | "description": "这是马哥闲来无事做的一套基于layui的cms模版,纯静态页面,不包含数据库", 11 | "powerby": "copyright @2017 请叫我马哥", 12 | "record": "京ICP备14040xxx号-1", 13 | "keywords": "layui,马哥,cms,模版" 14 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/component/RestExceptionAdvice.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.component; 2 | 3 | import org.alex.admin.core.advice.ExceptionAdvice; 4 | import org.springframework.web.bind.annotation.ControllerAdvice; 5 | import org.springframework.web.bind.annotation.ResponseBody; 6 | 7 | /** 8 | * 全局异常处理 9 | * Created by Gaojun.Zhou 2017年6月20日 10 | */ 11 | @ControllerAdvice 12 | @ResponseBody 13 | public class RestExceptionAdvice extends ExceptionAdvice{ 14 | 15 | } 16 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/css/base.css: -------------------------------------------------------------------------------- 1 | .imgbox { 2 | line-height: 120px; 3 | height: 120px; 4 | width: 120px; 5 | } 6 | .img-thumbnail { 7 | padding: 4px; 8 | line-height: 1.42857143; 9 | background-color: #fff; 10 | border: 1px solid #ddd; 11 | border-radius: 4px; 12 | -webkit-transition: all .2s ease-in-out; 13 | -o-transition: all .2s ease-in-out; 14 | transition: all .2s ease-in-out; 15 | display: inline-block; 16 | max-width: 100%; 17 | height: auto; 18 | } -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/anno/Resource.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.anno; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | /** 9 | * 权限资源 10 | * Created by Gaojun.Zhou 2017年7月6日 11 | */ 12 | @Target(ElementType.METHOD) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Documented 15 | public @interface Resource { 16 | String value(); 17 | } 18 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/anno/PassLogin.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.anno; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | /** 9 | * 跳过登录拦截 10 | * Created by Gaojun.Zhou 2017年7月6日 11 | */ 12 | @Target(ElementType.METHOD) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Documented 15 | public @interface PassLogin { 16 | String value() default ""; 17 | } 18 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/jsonp/JsonpSupportAdvice.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.jsonp; 2 | import org.springframework.web.bind.annotation.ControllerAdvice; 3 | import org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpResponseBodyAdvice; 4 | /** 5 | * JSONP支持 6 | * @author Administrator 7 | * 8 | */ 9 | @ControllerAdvice 10 | public class JsonpSupportAdvice extends AbstractJsonpResponseBodyAdvice { 11 | public JsonpSupportAdvice() { 12 | //参数包含callback的时候 使用jsonp返回数据 13 | super("callback"); 14 | } 15 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/xml/SysUserRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/anno/ForbidMethod.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.anno; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 禁止访问方法注解,标注在Controller上 11 | * Created by Gaojun.Zhou 2017年6月9日 12 | */ 13 | @Target(ElementType.TYPE) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Documented 16 | public @interface ForbidMethod { 17 | 18 | String[] value() default {}; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/controller/ErrorController.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | /** 7 | * 错误页面 8 | * Created by Gaojun.Zhou 2017年7月6日 9 | */ 10 | @Controller 11 | @RequestMapping("/error") 12 | public class ErrorController{ 13 | 14 | @RequestMapping("/{page}") 15 | public String errorPage(@PathVariable String page) { 16 | // TODO Auto-generated method stub 17 | return "error/"+page; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/SysRoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.mapper; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.alex.admin.web.entity.SysRoleMenu; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import com.baomidou.mybatisplus.mapper.BaseMapper; 10 | 11 | /** 12 | *

13 | * 角色菜单关联表 Mapper 接口 14 | *

15 | * 16 | * @author GaoJun.Zhou 17 | * @since 2017-06-30 18 | */ 19 | public interface SysRoleMenuMapper extends BaseMapper { 20 | 21 | List> selectAuthByRoleId(@Param("roleId") String roleId); 22 | 23 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | /** 7 | * 首页控制器 8 | * Created by Gaojun.Zhou 2017年6月23日 9 | */ 10 | @Controller 11 | 12 | public class IndexController{ 13 | 14 | @RequestMapping(value = {"","/","/index"}) 15 | public String index(Model model){ 16 | return "index"; 17 | } 18 | @RequestMapping("/welcome") 19 | public String welcome(){ 20 | return "welcome"; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/ISysRoleMenuService.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.alex.admin.web.entity.SysRoleMenu; 7 | 8 | import com.baomidou.mybatisplus.service.IService; 9 | 10 | /** 11 | *

12 | * 角色菜单关联表 服务类 13 | *

14 | * 15 | * @author GaoJun.Zhou 16 | * @since 2017-06-30 17 | */ 18 | public interface ISysRoleMenuService extends IService { 19 | 20 | /** 21 | * 获取当前角色权限 22 | * @param id 23 | * @return 24 | */ 25 | List> selectAuthByRoleId(String id); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/impl/SysRoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service.impl; 2 | 3 | import org.alex.admin.web.entity.SysRole; 4 | import org.alex.admin.web.mapper.SysRoleMapper; 5 | import org.alex.admin.web.service.ISysRoleService; 6 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 角色表 服务实现类 12 | *

13 | * 14 | * @author GaoJun.Zhou 15 | * @since 2017-06-30 16 | */ 17 | @Service 18 | public class SysRoleServiceImpl extends ServiceImpl implements ISysRoleService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/impl/SysSettingServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service.impl; 2 | 3 | import org.alex.admin.web.entity.SysSetting; 4 | import org.alex.admin.web.mapper.SysSettingMapper; 5 | import org.alex.admin.web.service.ISysSettingService; 6 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 系统设置表 服务实现类 12 | *

13 | * 14 | * @author GaoJun.Zhou 15 | * @since 2017-06-30 16 | */ 17 | @Service 18 | public class SysSettingServiceImpl extends ServiceImpl implements ISysSettingService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/xml/SysRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/impl/SysUserRoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service.impl; 2 | 3 | import org.alex.admin.web.entity.SysUserRole; 4 | import org.alex.admin.web.mapper.SysUserRoleMapper; 5 | import org.alex.admin.web.service.ISysUserRoleService; 6 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | *

11 | * 用户角色关联表 服务实现类 12 | *

13 | * 14 | * @author GaoJun.Zhou 15 | * @since 2017-06-30 16 | */ 17 | @Service 18 | public class SysUserRoleServiceImpl extends ServiceImpl implements ISysUserRoleService { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/common/version.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/anno/Log.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.anno; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 记录业务日志 11 | * @author Administrator 12 | * 13 | */ 14 | @Target(ElementType.METHOD) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Documented 17 | public @interface Log { 18 | /** 19 | * 日志标题 20 | * @return 21 | */ 22 | String title() default ""; 23 | /** 24 | * 日志内容 25 | * @return 26 | */ 27 | String value() default ""; 28 | } 29 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/SysMenuMapper.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.mapper; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.alex.admin.web.entity.SysMenu; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import com.baomidou.mybatisplus.mapper.BaseMapper; 10 | 11 | /** 12 | *

13 | * 菜单表 Mapper 接口 14 | *

15 | * 16 | * @author GaoJun.Zhou 17 | * @since 2017-06-30 18 | */ 19 | public interface SysMenuMapper extends BaseMapper { 20 | 21 | List> selectMenuByUid(@Param("uid") String uid, @Param("pid") String pid); 22 | 23 | List selectResourceByUid(@Param("uid") String uid); 24 | 25 | } -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/xml/SysSettingMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/json/linksList.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "linksId" : "1", 3 | "linksName" : "layui - 经典模块化前端框架", 4 | "linksUrl" : "http://www.layui.com", 5 | "masterEmail" : "xianxin@layui.com", 6 | "linksTime" : "2017-05-14", 7 | "showAddress" : "首页" 8 | },{ 9 | "linksId" : "2", 10 | "linksName" : "layer官方演示与讲解", 11 | "linksUrl" : "http://layer.layui.com", 12 | "masterEmail" : "xianxin@layer.com", 13 | "linksTime" : "2017-05-15", 14 | "showAddress" : "子页" 15 | },{ 16 | "linksId" : "3", 17 | "linksName" : "layui - 前端框架官方社区", 18 | "linksUrl" : "http://fly.layui.com", 19 | "masterEmail" : "xianxin@fly.com", 20 | "linksTime" : "2017-05-12", 21 | "showAddress" : "子页" 22 | }] -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/json/usersList.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "usersId" : "1", 3 | "userName" : "贤心", 4 | "userEmail" : "xianxin@layui.com", 5 | "userSex" : "男", 6 | "userStatus" : "正常使用", 7 | "userGrade" : "高级会员", 8 | "userEndTime" : "2017-05-14 15:35" 9 | },{ 10 | "usersId" : "2", 11 | "userName" : "纸飞机", 12 | "userEmail" : "fly@layui.com", 13 | "userSex" : "男", 14 | "userStatus" : "正常使用", 15 | "userGrade" : "高级会员", 16 | "userEndTime" : "2017-05-14 16:25" 17 | },{ 18 | "usersId" : "3", 19 | "userName" : "请叫我马哥", 20 | "userEmail" : "mage@layui.com", 21 | "userSex" : "男", 22 | "userStatus" : "正常使用", 23 | "userGrade" : "超级会员", 24 | "userEndTime" : "2017-05-10 10:30" 25 | }] -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/ISysUserService.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service; 2 | 3 | import org.alex.admin.web.entity.SysUser; 4 | import com.baomidou.mybatisplus.service.IService; 5 | 6 | /** 7 | *

8 | * 用户表 服务类 9 | *

10 | * 11 | * @author GaoJun.Zhou 12 | * @since 2017-06-30 13 | */ 14 | public interface ISysUserService extends IService { 15 | 16 | /** 17 | * 创建用户 18 | * @param user 19 | * @param roleId 20 | */ 21 | void addUser(SysUser user, String[] roleIds); 22 | 23 | /** 24 | * 更新用户 25 | * @param user 26 | * @param roleIds 27 | */ 28 | void updateUser(SysUser user, String[] roleIds); 29 | 30 | /** 31 | * 删除用户 32 | * @param id 33 | */ 34 | void deleteUser(String[] id); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/xml/SysUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/controller/CommonController.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | /** 7 | * common模板控制器 8 | * Created by Gaojun.Zhou 2017年6月23日 9 | */ 10 | @Controller 11 | public class CommonController{ 12 | 13 | @RequestMapping("/common/{c}") 14 | public String common(@PathVariable String c){ 15 | return "common/" + c; 16 | } 17 | 18 | @RequestMapping("/pages/{p}") 19 | public String page(@PathVariable String p){ 20 | return "pages/" + p; 21 | } 22 | 23 | @RequestMapping("/pages/{p}/{p2}") 24 | public String page(@PathVariable String p,@PathVariable String p2){ 25 | return "pages/" + p + "/" + p2; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/common/header.html: -------------------------------------------------------------------------------- 1 | 2 | Layui-Admin-权限管理系统 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/ISysMenuService.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.alex.admin.web.entity.SysMenu; 7 | 8 | import com.baomidou.mybatisplus.service.IService; 9 | 10 | /** 11 | *

12 | * 菜单表 服务类 13 | *

14 | * 15 | * @author GaoJun.Zhou 16 | * @since 2017-06-30 17 | */ 18 | public interface ISysMenuService extends IService { 19 | 20 | /** 21 | * 分配权限 22 | * @param roleId 23 | * @param menuIds 24 | */ 25 | void updateAuth(String roleId, String menuIds); 26 | 27 | /** 28 | * 查询用户菜单 29 | * @param uid 用户ID 30 | * @param pid 上级菜单ID 31 | * @return 32 | */ 33 | List> selectMenuByUid(String uid, String pid); 34 | 35 | /** 36 | * 获取当前用户的权限资源 37 | * @param uid 38 | * @return 39 | */ 40 | List selectResourceByUid(String uid); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # layui-admin 2 | ### 轻量级权限管理框架 3 | 4 | ### 技术选型 5 | ------------- 6 | Layui、Spring MVC、Mybatis、Mybatis-Plus(Mybatis增强插件)、Mysql、Maven 7 | 8 | ### 快速开始 9 | ------------- 10 | 1. git clone https://github.com/zhougaojun618/layui-admin 11 | 2. cd ~/alex-admin && mvn install 12 | 3. cd alex-admin-web && mvn jetty:run 13 | 4. http://localhost:8080 14 | 5. 账号/密码:admin/admin888 15 | 16 | ### 参考项目 17 | ------------- 18 | http://www.layui.com/ 19 | 20 | http://fly.layui.com/case/2017/ 21 | 22 | http://mp.baomidou.com/#/ 23 | 24 | ### 项目截图 25 | ------------- 26 | ![image](https://github.com/zhougaojun618/layui-admin/blob/master/imgs/1.png) 27 | ![image](https://github.com/zhougaojun618/layui-admin/blob/master/imgs/2.png) 28 | ![image](https://github.com/zhougaojun618/layui-admin/blob/master/imgs/3.png) 29 | ![image](https://github.com/zhougaojun618/layui-admin/blob/master/imgs/4.png) 30 | 31 | ### 开发进度 32 | ------------- 33 | 第一个版本已完成,正在努力优化中... 34 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/xml/SysLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9_rls MIT License By http://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #ddd;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:30px;line-height:30px;border-bottom:1px solid #ddd}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #ddd;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/impl/SysRoleMenuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service.impl; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.alex.admin.web.entity.SysRoleMenu; 7 | import org.alex.admin.web.mapper.SysRoleMenuMapper; 8 | import org.alex.admin.web.service.ISysRoleMenuService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | 14 | /** 15 | *

16 | * 角色菜单关联表 服务实现类 17 | *

18 | * 19 | * @author GaoJun.Zhou 20 | * @since 2017-06-30 21 | */ 22 | @Service 23 | public class SysRoleMenuServiceImpl extends ServiceImpl implements ISysRoleMenuService { 24 | 25 | @Autowired private SysRoleMenuMapper sysRoleMenuMapper; 26 | 27 | @Override 28 | public List> selectAuthByRoleId(String id) { 29 | // TODO Auto-generated method stub 30 | return sysRoleMenuMapper.selectAuthByRoleId(id); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9_rls MIT License By http://www.layui.com */ 2 | ;layui.define("jquery",function(l){"use strict";var o=layui.jquery,i={fixbar:function(l){l=l||{},l.bgcolor=l.bgcolor?"background-color:"+l.bgcolor:"";var i,a,c="layui-fixbar-top",t=[l.bar1===!0?"":l.bar1,l.bar2===!0?"":l.bar2,""],r=o(['
    ',l.bar1?'
  • '+t[0]+"
  • ":"",l.bar2?'
  • '+t[1]+"
  • ":"",'
  • '+t[2]+"
  • ","
"].join("")),e=r.find("."+c),s=function(){var i=o(document).scrollTop();i>=(l.showHeight||200)?a||(e.show(),a=1):a&&(e.hide(),a=0)};o(".layui-fixbar")[0]||("object"==typeof l.css&&r.css(l.css),o("body").append(r),s(),r.find("li").on("click",function(){var i=o(this),a=i.attr("lay-type");"top"===a&&o("html,body").animate({scrollTop:0},200),l.click&&l.click.call(this,a)}),o(document).on("scroll",function(){i&&clearTimeout(i),i=setTimeout(function(){s()},100)}))}};l("util",i)}); -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/xml/SysRoleMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG,INFO,ERROR,Console 2 | log4j.logger.org.mybatis = INFO 3 | #Console 4 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 5 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.Console.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] [%c.%M] [%L] - %m%n 7 | #RollingFile INFO 8 | log4j.appender.INFO=org.apache.log4j.DailyRollingFileAppender 9 | log4j.appender.INFO.layout=org.apache.log4j.PatternLayout 10 | log4j.appender.INFO.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] [%c.%M] [%L] - %m%n 11 | log4j.appender.INFO.Threshold=INFO 12 | log4j.appender.INFO.File=${root}/info.log 13 | #RollingFile2 ERROR 14 | log4j.appender.ERROR=org.apache.log4j.DailyRollingFileAppender 15 | log4j.appender.ERROR.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.ERROR.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] [%c.%M] [%L] - %m%n 17 | log4j.appender.ERROR.Threshold=ERROR 18 | log4j.appender.ERROR.Append=true 19 | log4j.appender.ERROR.File=${root}/error.log 20 | root=D:/logs/restfull-web-api -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/lay/modules/code.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9_rls MIT License By http://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/role/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 | 16 |
17 | 18 |
19 |
20 |
21 |
22 | 23 | 24 |
25 |
26 |
27 | <#include "/common/version.html"> 28 | 31 | 32 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/css/login.css: -------------------------------------------------------------------------------- 1 | .header { 2 | height: 60px; 3 | border-bottom: none; 4 | z-index: 10000; 5 | left: 0; 6 | top: 0; 7 | width: 100%; 8 | } 9 | .login-header { 10 | position: fixed; 11 | background-color: #23262E; 12 | } 13 | .login-logo { 14 | width: 1075px; 15 | margin: 0 auto; 16 | position: relative; 17 | } 18 | .login-logo a{ 19 | color: white; 20 | font-size: 24px; 21 | padding: 10px; 22 | line-height: 25px; 23 | } 24 | .login-logo .logo, 25 | .frame-header .logo { 26 | position: absolute; 27 | left: 10px; 28 | top: 5px; 29 | } 30 | .login-logo .logo img, 31 | .frame-header .logo img { 32 | width: auto; 33 | height: 50px; 34 | } 35 | .login-main { 36 | width: 1075px; 37 | min-height: 600px; 38 | margin: 0 auto 15px; 39 | } 40 | .login-panel { 41 | padding: 20px; 42 | margin-bottom: 10px; 43 | background-color: #fff; 44 | border-radius: 2px; 45 | } 46 | .login-panel-user { 47 | padding-top: 5px; 48 | } 49 | .layui-form-pane .login-vercode { 50 | padding: 0; 51 | margin: 0; 52 | } 53 | .frame-header .layui-nav { 54 | position: absolute; 55 | right: 10px; 56 | top: 0; 57 | padding: 0; 58 | background: none; 59 | } -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/ex/ForbidAccessException.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.ex; 2 | 3 | /** 4 | * 禁止访问异常 5 | * Created by Gaojun.Zhou 2017年6月8日 6 | */ 7 | public class ForbidAccessException extends RuntimeException{ 8 | 9 | private static final long serialVersionUID = 1L; 10 | 11 | private int code = 405 ; 12 | 13 | public int getCode() { 14 | return code; 15 | } 16 | 17 | public void setCode(int code) { 18 | this.code = code; 19 | } 20 | 21 | public ForbidAccessException() { 22 | super("ForbidAccess"); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | public ForbidAccessException(String message, Throwable cause, boolean enableSuppression, 27 | boolean writableStackTrace) { 28 | super(message, cause, enableSuppression, writableStackTrace); 29 | // TODO Auto-generated constructor stub 30 | } 31 | 32 | public ForbidAccessException(String message, Throwable cause) { 33 | super(message, cause); 34 | // TODO Auto-generated constructor stub 35 | } 36 | 37 | public ForbidAccessException(String message) { 38 | super(message); 39 | // TODO Auto-generated constructor stub 40 | } 41 | 42 | public ForbidAccessException(Throwable cause) { 43 | super(cause); 44 | // TODO Auto-generated constructor stub 45 | } 46 | 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/role/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
8 | 9 |
10 | 11 |
12 | 13 |
14 |
15 |
16 | 17 |
18 | 19 |
20 |
21 |
22 |
23 | 24 | 25 |
26 |
27 |
28 | <#include "/common/version.html"> 29 | 32 | 33 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/ex/NotFindDataException.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.ex; 2 | 3 | /** 4 | * 未查到数据异常 5 | * Created by Gaojun.Zhou 2017年6月8日 6 | */ 7 | public class NotFindDataException extends RuntimeException{ 8 | 9 | private int code = 604 ; 10 | 11 | 12 | public int getCode() { 13 | return code; 14 | } 15 | 16 | public void setCode(int code) { 17 | this.code = code; 18 | } 19 | 20 | /** 21 | * 22 | */ 23 | private static final long serialVersionUID = 1L; 24 | 25 | public NotFindDataException() { 26 | super("Not find data"); 27 | // TODO Auto-generated constructor stub 28 | } 29 | 30 | public NotFindDataException(String message, Throwable cause, boolean enableSuppression, 31 | boolean writableStackTrace) { 32 | super(message, cause, enableSuppression, writableStackTrace); 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | public NotFindDataException(String message, Throwable cause) { 37 | super(message, cause); 38 | // TODO Auto-generated constructor stub 39 | } 40 | 41 | public NotFindDataException(String message) { 42 | super(message); 43 | // TODO Auto-generated constructor stub 44 | } 45 | 46 | public NotFindDataException(Throwable cause) { 47 | super(cause); 48 | // TODO Auto-generated constructor stub 49 | } 50 | 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/component/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.component; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | import springfox.documentation.builders.ApiInfoBuilder; 7 | import springfox.documentation.builders.PathSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.service.Contact; 10 | import springfox.documentation.spi.DocumentationType; 11 | import springfox.documentation.spring.web.plugins.Docket; 12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 13 | 14 | /** 15 | * swagger-ui配置 16 | * Created by Gaojun.Zhou 2017年6月19日 17 | */ 18 | @EnableSwagger2 19 | @Configuration 20 | public class SwaggerConfig { 21 | 22 | @Bean 23 | public Docket createRestApi() { 24 | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select() 25 | //.apis(RequestHandlerSelectors.basePackage("com.vacomall.controller")) 26 | .paths(PathSelectors.any()) 27 | .build(); 28 | } 29 | 30 | private ApiInfo apiInfo() { 31 | return new ApiInfoBuilder().title("Alex轻量级权限管理框架") 32 | .termsOfServiceUrl("http://blog.jdoop.cn/") 33 | .description("springmvc + swagger2 轻量级权限管理框架") 34 | .contact(new Contact("JamesZhou", "http://blog.jdoop.cn/", "gaojun.zhou@qq.com")) 35 | .version("1.0.0") 36 | .build(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/js/jqmodules/jqdate.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: Paco 3 | * @Date: 2017-02-13 4 | * +---------------------------------------------------------------------- 5 | * | jqadmin [ jq酷打造的一款懒人后台模板 ] 6 | * | Copyright (c) 2017 http://jqadmin.jqcool.net All rights reserved. 7 | * | Licensed ( http://jqadmin.jqcool.net/licenses/ ) 8 | * | Author: Paco 9 | * +---------------------------------------------------------------------- 10 | */ 11 | 12 | layui.define(['jquery', 'laydate'], function(exports) { 13 | var $ = layui.jquery, 14 | laydate = layui.laydate, 15 | start = { 16 | min: laydate.now(), 17 | max: '2099-06-16 23:59:59', 18 | istoday: false, 19 | choose: function(datas) { 20 | end.min = datas; 21 | end.start = datas 22 | } 23 | }, 24 | 25 | end = { 26 | min: laydate.now(), 27 | max: '2099-06-16 23:59:59', 28 | istoday: false, 29 | choose: function(datas) { 30 | start.max = datas; //结束日选好后,重置开始日的最大日期 31 | } 32 | }; 33 | 34 | $('.start-date').click(function() { 35 | start.elem = this; 36 | laydate(start); 37 | }) 38 | 39 | $('.end-date').click(function() { 40 | end.elem = this; 41 | laydate(end); 42 | }) 43 | 44 | exports('jqdate', {}); 45 | }); -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/entity/SysRoleMenu.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.entity; 2 | 3 | import com.baomidou.mybatisplus.activerecord.Model; 4 | import com.baomidou.mybatisplus.annotations.TableId; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.baomidou.mybatisplus.enums.IdType; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | *

12 | * 角色菜单关联表 13 | *

14 | * 15 | * @author GaoJun.Zhou 16 | * @since 2017-06-30 17 | */ 18 | @TableName("sys_role_menu") 19 | public class SysRoleMenu extends Model { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * 主键 25 | */ 26 | @TableId(type=IdType.UUID) 27 | private String id; 28 | /** 29 | * 角色主键 30 | */ 31 | private String roleId; 32 | /** 33 | * 菜单主键 34 | */ 35 | private String menuId; 36 | 37 | 38 | public String getId() { 39 | return id; 40 | } 41 | 42 | public void setId(String id) { 43 | this.id = id; 44 | } 45 | 46 | public String getRoleId() { 47 | return roleId; 48 | } 49 | 50 | public void setRoleId(String roleId) { 51 | this.roleId = roleId; 52 | } 53 | 54 | public String getMenuId() { 55 | return menuId; 56 | } 57 | 58 | public void setMenuId(String menuId) { 59 | this.menuId = menuId; 60 | } 61 | 62 | @Override 63 | protected Serializable pkVal() { 64 | return this.id; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/entity/SysUserRole.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.entity; 2 | 3 | import com.baomidou.mybatisplus.activerecord.Model; 4 | import com.baomidou.mybatisplus.annotations.TableId; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.baomidou.mybatisplus.enums.IdType; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | *

12 | * 用户角色关联表 13 | *

14 | * 15 | * @author GaoJun.Zhou 16 | * @since 2017-06-30 17 | */ 18 | @TableName("sys_user_role") 19 | public class SysUserRole extends Model { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * 主键 25 | */ 26 | @TableId(type=IdType.UUID) 27 | private String Id; 28 | /** 29 | * 用户主键 30 | */ 31 | private String userId; 32 | /** 33 | * 角色主键 34 | */ 35 | private String roleId; 36 | 37 | 38 | public String getId() { 39 | return Id; 40 | } 41 | 42 | public void setId(String Id) { 43 | this.Id = Id; 44 | } 45 | 46 | public String getUserId() { 47 | return userId; 48 | } 49 | 50 | public void setUserId(String userId) { 51 | this.userId = userId; 52 | } 53 | 54 | public String getRoleId() { 55 | return roleId; 56 | } 57 | 58 | public void setRoleId(String roleId) { 59 | this.roleId = roleId; 60 | } 61 | 62 | @Override 63 | protected Serializable pkVal() { 64 | return this.Id; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/json/message.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "msgId" : "1111", 3 | "userface" : "../../images/userface1.jpg", 4 | "userName" : "小王", 5 | "userAsk" : "马哥你好,请问你这个模版用的是什么框架啊?", 6 | "askTime" : "2017-05-27 12:50", 7 | "msgReply" : [{ 8 | "userface" : "../../images/face.jpg", 9 | "userName" : "请叫我马哥", 10 | "userAsk" : "用的layui,贤心大神开发的前端框架", 11 | "askTime" : "2017-05-27 13:50" 12 | }] 13 | },{ 14 | "msgId" : "2222", 15 | "userface" : "../../images/userface2.jpg", 16 | "userName" : "小李", 17 | "userAsk" : "马哥你好,请问你多大了?", 18 | "askTime" : "2017-05-27 12:50", 19 | "msgReply" : [] 20 | },{ 21 | "msgId" : "3333", 22 | "userface" : "../../images/userface3.jpg", 23 | "userName" : "小赵", 24 | "userAsk" : "马哥你好,请问你家是哪的?", 25 | "askTime" : "2017-05-27 12:50", 26 | "msgReply" : [] 27 | },{ 28 | "msgId" : "4444", 29 | "userface" : "../../images/userface4.jpg", 30 | "userName" : "小高", 31 | "userAsk" : "马哥你好,请问你有没有女朋友啊?", 32 | "askTime" : "2017-05-27 12:50", 33 | "msgReply" : [{ 34 | "userface" : "../../images/face.jpg", 35 | "userName" : "请叫我马哥", 36 | "userAsk" : "这个貌似和技术无关吧,难道你想给我当老婆,呵呵。。。", 37 | "askTime" : "2017-05-27 13:50" 38 | }] 39 | },{ 40 | "msgId" : "5555", 41 | "userface" : "../../images/userface5.jpg", 42 | "userName" : "小楚", 43 | "userAsk" : "马哥你好,请问你一个月工资多少啊?", 44 | "askTime" : "2017-05-27 12:50", 45 | "msgReply" : [] 46 | }] -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/js/nav.js: -------------------------------------------------------------------------------- 1 | var navs = [{ 2 | "title" : "后台首页", 3 | "icon" : "icon-computer", 4 | "href" : "/pages/main.html", 5 | "spread" : false 6 | },{ 7 | "title" : "系统管理", 8 | "icon" : "icon-settings", 9 | "href" : "", 10 | "spread" : false, 11 | "children" : [ 12 | { 13 | "title" : "用户管理", 14 | "icon" : "icon-yonghu", 15 | "href" : "/user/list", 16 | "spread" : false 17 | }, 18 | { 19 | "title" : "角色管理", 20 | "icon" : "icon-jiaose", 21 | "href" : "/role/list", 22 | "spread" : false 23 | }, 24 | { 25 | "title" : "菜单管理", 26 | "icon" : "icon-menu", 27 | "href" : "/menu/list", 28 | "spread" : false 29 | } 30 | ] 31 | },{ 32 | "title" : "文章列表", 33 | "icon" : "icon-text", 34 | "href" : "/pages/news/newsList.html", 35 | "spread" : false 36 | },{ 37 | "title" : "友情链接", 38 | "icon" : "icon-text", 39 | "href" : "/pages/links/linksList.html", 40 | "spread" : false 41 | },{ 42 | "title" : "404页面", 43 | "icon" : "", 44 | "href" : "/pages/404.html", 45 | "spread" : false 46 | },{ 47 | "title" : "系统基本参数", 48 | "icon" : "", 49 | "href" : "/pages/systemParameter/systemParameter.html", 50 | "spread" : false 51 | },{ 52 | "title" : "二级菜单演示", 53 | "icon" : "", 54 | "href" : "", 55 | "spread" : false, 56 | "children" : [ 57 | { 58 | "title" : "二级菜单1", 59 | "icon" : "", 60 | "href" : "", 61 | "spread" : false 62 | }, 63 | { 64 | "title" : "二级菜单2", 65 | "icon" : "", 66 | "href" : "", 67 | "spread" : false 68 | } 69 | ] 70 | }] -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/interceptor/LoginInterceptor.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.interceptor; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.alex.admin.core.anno.PassLogin; 9 | import org.alex.admin.web.util.BaseUtil; 10 | import org.springframework.web.method.HandlerMethod; 11 | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; 12 | /** 13 | * 登录拦截器 14 | * Created by Gaojun.Zhou 2017年7月6日 15 | */ 16 | public class LoginInterceptor extends HandlerInterceptorAdapter { 17 | 18 | @Override 19 | public boolean preHandle(HttpServletRequest request, 20 | HttpServletResponse response, Object handler) throws Exception { 21 | // TODO Auto-generated method stub 22 | 23 | if (handler instanceof HandlerMethod) { 24 | /** 25 | * 登录验证 26 | */ 27 | HandlerMethod handlerMethod = (HandlerMethod) handler; 28 | Method method = handlerMethod.getMethod(); 29 | 30 | PassLogin passLogin = method.getAnnotation(PassLogin.class); 31 | if (passLogin != null) { 32 | //跳过登录拦截 33 | return true; 34 | }else{ 35 | //登录验证 36 | if(request.getSession().getAttribute("session_user") == null){ 37 | if (BaseUtil.isAjax(request)) { 38 | throw new RuntimeException("您的登录已失效,请重新登录"); 39 | } else { 40 | BaseUtil.clearRedirectLogin(request, response); 41 | return false; 42 | } 43 | } 44 | 45 | } 46 | } 47 | 48 | /** 49 | * 通过拦截 50 | */ 51 | return true; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9_rls MIT License By http://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},n={exp:function(e){return new RegExp(e,"g")},query:function(e,n,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return c((n||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var n="Laytpl Error:";return"object"==typeof console&&console.error(n+e+"\n"+(r||"")),n+e}},c=n.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=c("^"+r.open+"#",""),l=c(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(c(r.open+"#"),r.open+"# ").replace(c(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(/(?="|')/g,"\\").replace(n.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(n.query(1),function(e){var n='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(c(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),n='"+_escape_('),n+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,n.escape)}catch(u){return delete o.cache,n.error(u,p)}},t.pt.render=function(e,r){var c,t=this;return e?(c=t.cache?t.cache(e,n.escape):t.parse(t.tpl,e),r?void r(c):c):n.error("no data")};var o=function(e){return"string"!=typeof e?n.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var n in e)r[n]=e[n]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/impl/SysLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service.impl; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.alex.admin.core.log.LogApi; 6 | import org.alex.admin.core.log.LogBean; 7 | import org.alex.admin.web.entity.SysLog; 8 | import org.alex.admin.web.entity.SysUser; 9 | import org.alex.admin.web.mapper.SysLogMapper; 10 | import org.alex.admin.web.service.ISysLogService; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 15 | 16 | /** 17 | *

18 | * 日志表 服务实现类 19 | *

20 | * 21 | * @author GaoJun.Zhou 22 | * @since 2017-06-30 23 | */ 24 | @Service 25 | public class SysLogServiceImpl extends ServiceImpl implements ISysLogService,LogApi { 26 | 27 | @Autowired private HttpServletRequest request; 28 | 29 | @Override 30 | public void log(LogBean log) { 31 | // TODO Auto-generated method stub 32 | 33 | SysLog sysLog = new SysLog(); 34 | sysLog.setClientIp(log.getClientIp()); 35 | sysLog.setLogContent(log.getLogContent()); 36 | sysLog.setLogTime(log.getLogTime()); 37 | sysLog.setLogTitle(log.getLogTitle()); 38 | sysLog.setOther(log.getOther()); 39 | sysLog.setRequestMethod(log.getRequestMethod()); 40 | sysLog.setRequestParams(log.getRequestParams()); 41 | sysLog.setRequestUrl(log.getRequestUrl()); 42 | sysLog.setUserName(((SysUser)request.getSession().getAttribute("session_user")).getUserName()); 43 | this.insert(sysLog); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/resources/xml/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/jackson/CustomObjectMapper.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.jackson; 2 | 3 | import java.text.DateFormat; 4 | import java.text.SimpleDateFormat; 5 | 6 | import org.springframework.util.StringUtils; 7 | 8 | import com.fasterxml.jackson.annotation.JsonInclude; 9 | import com.fasterxml.jackson.databind.ObjectMapper; 10 | import com.fasterxml.jackson.databind.PropertyNamingStrategy; 11 | import com.fasterxml.jackson.databind.SerializationFeature; 12 | 13 | /** 14 | * Json转换配置 15 | * @author Administrator 16 | * 17 | */ 18 | public class CustomObjectMapper extends ObjectMapper { 19 | 20 | /** 21 | * 22 | */ 23 | private static final long serialVersionUID = 1L; 24 | 25 | private boolean camelCaseToLowerCaseWithUnderscores = false; 26 | private String dateFormatPattern; 27 | 28 | public void setCamelCaseToLowerCaseWithUnderscores( 29 | boolean camelCaseToLowerCaseWithUnderscores) { 30 | this.camelCaseToLowerCaseWithUnderscores = camelCaseToLowerCaseWithUnderscores; 31 | } 32 | 33 | public void setDateFormatPattern(String dateFormatPattern) { 34 | this.dateFormatPattern = dateFormatPattern; 35 | } 36 | 37 | public void init() { 38 | // 排除值为空属性 39 | setSerializationInclusion(JsonInclude.Include.NON_NULL); 40 | // 进行缩进输出 41 | configure(SerializationFeature.INDENT_OUTPUT, true); 42 | // 将驼峰转为下划线 43 | if (camelCaseToLowerCaseWithUnderscores) { 44 | setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); 45 | } 46 | // 进行日期格式化 47 | if (!StringUtils.isEmpty(dateFormatPattern)) { 48 | DateFormat dateFormat = new SimpleDateFormat(dateFormatPattern); 49 | setDateFormat(dateFormat); 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/mapper/xml/SysMenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 34 | 35 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/json/menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "status" : 200, 3 | "data":[{ 4 | "title" : "后台首页", 5 | "icon" : "icon-computer", 6 | "href" : "/pages/main.html", 7 | "spread" : false 8 | },{ 9 | "title" : "系统管理", 10 | "icon" : "icon-settings", 11 | "href" : "", 12 | "spread" : false, 13 | "children" : [ 14 | { 15 | "title" : "用户管理", 16 | "icon" : "icon-yonghu", 17 | "href" : "/user/list", 18 | "spread" : false 19 | }, 20 | { 21 | "title" : "角色管理", 22 | "icon" : "icon-jiaose", 23 | "href" : "/role/list", 24 | "spread" : false 25 | }, 26 | { 27 | "title" : "菜单管理", 28 | "icon" : "icon-menu", 29 | "href" : "/menu/list", 30 | "spread" : false 31 | } 32 | ] 33 | },{ 34 | "title" : "文章列表", 35 | "icon" : "icon-text", 36 | "href" : "/pages/news/newsList.html", 37 | "spread" : false 38 | },{ 39 | "title" : "友情链接", 40 | "icon" : "icon-text", 41 | "href" : "/pages/links/linksList.html", 42 | "spread" : false 43 | },{ 44 | "title" : "404页面", 45 | "icon" : "", 46 | "href" : "/pages/404.html", 47 | "spread" : false 48 | },{ 49 | "title" : "系统基本参数", 50 | "icon" : "", 51 | "href" : "/pages/systemParameter/systemParameter.html", 52 | "spread" : false 53 | },{ 54 | "title" : "二级菜单演示", 55 | "icon" : "", 56 | "href" : "", 57 | "spread" : false, 58 | "children" : [ 59 | { 60 | "title" : "二级菜单1", 61 | "icon" : "", 62 | "href" : "", 63 | "spread" : false 64 | }, 65 | { 66 | "title" : "二级菜单2", 67 | "icon" : "", 68 | "href" : "", 69 | "spread" : false 70 | } 71 | ] 72 | }] 73 | 74 | } -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/advice/ForbidMethodAdvice.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.advice; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import org.alex.admin.core.anno.ForbidMethod; 6 | import org.alex.admin.core.ex.ForbidAccessException; 7 | import org.apache.commons.lang.ArrayUtils; 8 | import org.apache.log4j.Logger; 9 | import org.aspectj.lang.JoinPoint; 10 | import org.aspectj.lang.annotation.Aspect; 11 | import org.aspectj.lang.annotation.Before; 12 | import org.aspectj.lang.annotation.Pointcut; 13 | import org.aspectj.lang.reflect.MethodSignature; 14 | import org.springframework.stereotype.Component; 15 | 16 | /** 17 | * 禁止指定方法访问 18 | * Created by Gaojun.Zhou 2017年6月21日 19 | */ 20 | @Aspect 21 | @Component 22 | public class ForbidMethodAdvice { 23 | 24 | public static final Logger logger = Logger.getLogger(ForbidMethodAdvice.class); 25 | 26 | @Pointcut("this(org.alex.admin.core.controller.CrudController)") 27 | public void controllerAspect() { 28 | 29 | } 30 | /** 31 | * 当方法开始执行之前执行 32 | * @param joinPoint 33 | */ 34 | @Before("controllerAspect()") 35 | public void doBefore(JoinPoint joinPoint) { 36 | 37 | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); 38 | Method method = methodSignature.getMethod(); 39 | 40 | String name = method.getName(); //方法名称 41 | Object ctr = joinPoint.getTarget(); //当前控制器 42 | 43 | logger.debug("methodName : " + name + ", ctr : " + ctr); 44 | 45 | ForbidMethod forbidMethodAnno = joinPoint.getTarget().getClass().getAnnotation(ForbidMethod.class); 46 | if(forbidMethodAnno!=null){ 47 | String[] value = forbidMethodAnno.value(); 48 | if(ArrayUtils.contains(value, name)){ 49 | throw new ForbidAccessException(name+"方法禁止访问"); 50 | } 51 | } 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9_rls MIT License By http://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.jquery,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var u=l(e.elem);if(u[0]){var f=l(e.scrollElem||document),m=e.mb||50,s=!("isAuto"in e)||e.isAuto,y=e.end||"没有更多了",v=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");u.find(".layui-flow-more")[0]||u.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(y):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(f.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=v?e.height():l(window).height(),n=v?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=m&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var f=e.attr("lay-src");layui.img(f,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",f).removeAttr("lay-src"),l[0]&&u(l),i++})}},u=function(e,o){var u=a?(o||n).height():l(window).height(),f=n.scrollTop(),m=f+u;if(t.lazyimg.elem=l(r),e)c(e,u);else for(var s=0;sm)break}};if(u(),!o){var f;n.on("scroll",function(){var e=l(this);f&&clearTimeout(f),f=setTimeout(function(){u(null,e)},50)}),o=!0}return u},e("flow",new o)}); -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/js/list.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: Paco 3 | * @Date: 2017-02-07 4 | * +---------------------------------------------------------------------- 5 | * | jqadmin [ jq酷打造的一款懒人后台模板 ] 6 | * | Copyright (c) 2017 http://jqadmin.jqcool.net All rights reserved. 7 | * | Licensed ( http://jqadmin.jqcool.net/licenses/ ) 8 | * | Author: Paco 9 | * +---------------------------------------------------------------------- 10 | */ 11 | 12 | var oneList = {} ; 13 | 14 | layui.define(['jquery', 'dtable', 'jqdate', 'jqform', 'upload'], function(exports) { 15 | var $ = layui.jquery, 16 | list = layui.dtable, 17 | ajax = layui.ajax, 18 | laydate = layui.laydate, 19 | form = layui.jqform; 20 | 21 | oneList = new list(); 22 | oneList.init('list-tpl'); 23 | /** 24 | * ajax回调 25 | */ 26 | ajax.reloadTab = function(ret, options, that) { 27 | oneList.init('list-tpl'); 28 | } 29 | 30 | //上传文件设置 31 | layui.upload({ 32 | url: './php/upload.php', 33 | before: function(input) { 34 | box = $(input).parent('form').parent('div').parent('.layui-input-block'); 35 | if (box.next('div').length > 0) { 36 | box.next('div').html('

上传中...

'); 37 | } else { 38 | box.after('

上传中...

'); 39 | } 40 | }, 41 | success: function(res) { 42 | if (res.status == 200) { 43 | box.next('div').find('div.imgbox').html('...'); 44 | box.find('input[type=hidden]').val(res.url); 45 | form.check(box.find('input[type=hidden]')); 46 | } else { 47 | box.next('div').find('p').html('上传失败...') 48 | } 49 | } 50 | }); 51 | 52 | exports('list', {}); 53 | }); -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/entity/SysRole.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import com.baomidou.mybatisplus.activerecord.Model; 7 | import com.baomidou.mybatisplus.annotations.TableId; 8 | import com.baomidou.mybatisplus.annotations.TableName; 9 | import com.baomidou.mybatisplus.enums.IdType; 10 | 11 | /** 12 | *

13 | * 角色表 14 | *

15 | * 16 | * @author GaoJun.Zhou 17 | * @since 2017-06-30 18 | */ 19 | @TableName("sys_role") 20 | public class SysRole extends Model { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * 主键 26 | */ 27 | @TableId(type=IdType.UUID) 28 | private String id; 29 | /** 30 | * 角色名称 31 | */ 32 | private String roleName; 33 | /** 34 | * 角色描述 35 | */ 36 | private String roleDesc; 37 | /** 38 | * 状态,1-启用,-1禁用 39 | */ 40 | private Integer roleState; 41 | /** 42 | * 创建时间 43 | */ 44 | private Date createTime; 45 | 46 | 47 | public String getId() { 48 | return id; 49 | } 50 | 51 | public void setId(String id) { 52 | this.id = id; 53 | } 54 | 55 | public String getRoleName() { 56 | return roleName; 57 | } 58 | 59 | public void setRoleName(String roleName) { 60 | this.roleName = roleName; 61 | } 62 | 63 | public String getRoleDesc() { 64 | return roleDesc; 65 | } 66 | 67 | public void setRoleDesc(String roleDesc) { 68 | this.roleDesc = roleDesc; 69 | } 70 | 71 | public Integer getRoleState() { 72 | return roleState; 73 | } 74 | 75 | public void setRoleState(Integer roleState) { 76 | this.roleState = roleState; 77 | } 78 | 79 | public Date getCreateTime() { 80 | return createTime; 81 | } 82 | 83 | public void setCreateTime(Date createTime) { 84 | this.createTime = createTime; 85 | } 86 | 87 | @Override 88 | protected Serializable pkVal() { 89 | return this.id; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/js/myform.js: -------------------------------------------------------------------------------- 1 | 2 | layui.define(['jquery', 'tags', 'layedit', 'jqform', 'upload'], function(exports) { 3 | var $ = layui.jquery, 4 | layedit = layui.layedit, 5 | box = "", 6 | form = layui.jqform, 7 | tags = layui.tags; 8 | 9 | form.set({ 10 | "blur": true, 11 | "form": "#form1", 12 | "complete":function(){ 13 | parent.oneList.init('list-tpl'); //表单提交成功回调,刷新当前table 14 | } 15 | }).init(); 16 | 17 | //自定义 18 | form.verify({ 19 | username: [ 20 | /^[a-zA-Z][a-zA-Z0-9_]{4,16}$/, '用户名字母开头,允许5-16字节,允许字母数字下划线' 21 | ], 22 | password: [ 23 | /^[a-zA-Z]\w{5,17}$/, '密码以字母开头,长度在6~18之间,只能包含字母、数字和下划线' 24 | ] 25 | }); 26 | tags.init(); 27 | 28 | //上传文件设置 29 | layui.upload({ 30 | url: '/file/upload', 31 | before: function(input) { 32 | box = $(input).parent('form').parent('div').parent('.layui-input-block'); 33 | if (box.next('div').length > 0) { 34 | box.next('div').html('

上传中...

'); 35 | } else { 36 | box.after('

上传中...

'); 37 | } 38 | }, 39 | success: function(res) { 40 | if (res.status == 200) { 41 | box.next('div').find('div.imgbox').html('...'); 42 | box.find('input[type=hidden]').val(res.url); 43 | form.check(box.find('input[type=hidden]')); 44 | } else { 45 | box.next('div').find('p').html('上传失败...') 46 | } 47 | } 48 | }); 49 | 50 | //富文本框 51 | layedit.set({ 52 | uploadImage: { 53 | url: '/uploda/upload.php' 54 | } 55 | }); 56 | var editIndex = layedit.build('content'); 57 | exports('myform', {}); 58 | }); -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/interceptor/ResourceInterceptor.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.interceptor; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.alex.admin.core.anno.Resource; 9 | import org.alex.admin.web.entity.SysUser; 10 | import org.alex.admin.web.service.ISysMenuService; 11 | import org.alex.admin.web.util.BaseUtil; 12 | import org.springframework.web.method.HandlerMethod; 13 | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; 14 | 15 | /** 16 | * 资源拦截器 17 | * @author Gaojun.Zhou 18 | * @date 2016年12月15日 下午2:35:27 19 | */ 20 | public class ResourceInterceptor extends HandlerInterceptorAdapter { 21 | 22 | private ISysMenuService sysMenuService; 23 | 24 | 25 | 26 | public ISysMenuService getSysMenuService() { 27 | return sysMenuService; 28 | } 29 | 30 | 31 | public void setSysMenuService(ISysMenuService sysMenuService) { 32 | this.sysMenuService = sysMenuService; 33 | } 34 | 35 | 36 | 37 | @Override 38 | public boolean preHandle(HttpServletRequest request, 39 | HttpServletResponse response, Object handler) throws Exception { 40 | // TODO Auto-generated method stub 41 | if (handler instanceof HandlerMethod) { 42 | HandlerMethod handlerMethod = (HandlerMethod) handler; 43 | Resource rce = handlerMethod.getMethodAnnotation(Resource.class); 44 | if(rce != null){ 45 | 46 | String uid = ((SysUser)request.getSession().getAttribute("session_user")).getId(); 47 | List resAll = sysMenuService.selectResourceByUid(uid); 48 | 49 | if(resAll.contains(rce.value())){ 50 | return true; 51 | } 52 | 53 | if (BaseUtil.isAjax(request)) { 54 | throw new RuntimeException("illegalAccess,无访问权限"); 55 | } else { 56 | request.setAttribute("url",request.getRequestURL()); 57 | request.getRequestDispatcher("/error/illegalAccess").forward(request, response); 58 | return false; 59 | } 60 | } 61 | } 62 | return true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/js/leftNav.js: -------------------------------------------------------------------------------- 1 | function navBar(data){ 2 | var ulHtml = ''; 48 | return ulHtml; 49 | } 50 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/js/index.js: -------------------------------------------------------------------------------- 1 | var $,tab,skyconsWeather; 2 | layui.config({ 3 | base : "/js/" 4 | }).use(['bodyTab','form','element','layer','jquery'],function(){ 5 | var form = layui.form(), 6 | layer = layui.layer, 7 | element = layui.element(); 8 | $ = layui.jquery; 9 | tab = layui.bodyTab(); 10 | 11 | //手机设备的简单适配 12 | var treeMobile = $('.site-tree-mobile'), 13 | shadeMobile = $('.site-mobile-shade') 14 | 15 | treeMobile.on('click', function(){ 16 | $('body').addClass('site-mobile'); 17 | }); 18 | 19 | shadeMobile.on('click', function(){ 20 | $('body').removeClass('site-mobile'); 21 | }); 22 | 23 | // 添加新窗口 24 | $(".layui-nav .layui-nav-item a").on("click",function(){ 25 | addTab($(this)); 26 | $(this).parent("li").siblings().removeClass("layui-nav-itemed"); 27 | }) 28 | 29 | //刷新后还原打开的窗口 30 | if(window.sessionStorage.getItem("menu") != null){ 31 | menu = JSON.parse(window.sessionStorage.getItem("menu")); 32 | curmenu = window.sessionStorage.getItem("curmenu"); 33 | var openTitle = ''; 34 | for(var i=0;i'; 38 | }else{ 39 | openTitle += ''+menu[i].icon+''; 40 | } 41 | openTitle += ''+menu[i].title+''; 42 | openTitle += ''; 43 | element.tabAdd("bodyTab",{ 44 | title : openTitle, 45 | content :"');return a("#"+n)[0]||r.append(u),s.each(function(r,s){s=a(s);var u='
',l=s.attr("lay-type")||t.type;t.unwrap||(u='
'+u+''+(s.attr("lay-title")||t.title||"上传"+(o[l]||"图片"))+"
"),u=a(u),t.unwrap||u.on("dragover",function(e){e.preventDefault(),a(this).addClass(i)}).on("dragleave",function(){a(this).removeClass(i)}).on("drop",function(){a(this).removeClass(i)}),s.parent("form").attr("target")===n&&(t.unwrap?s.unwrap():(s.parent().next().remove(),s.unwrap().unwrap())),s.wrap(u),s.off("change").on("change",function(){e.action(this,l)})})},s.prototype.action=function(e,i){var o=this,s=o.options,u=e.value,l=a(e),p=l.attr("lay-ext")||s.ext||"";if(u){switch(i){case"file":if(p&&!RegExp("\\w\\.("+p+")$","i").test(escape(u)))return t.msg("不支持该文件格式",r),e.value="";break;case"video":if(!RegExp("\\w\\.("+(p||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(u)))return t.msg("不支持该视频格式",r),e.value="";break;case"audio":if(!RegExp("\\w\\.("+(p||"mp3|wav|mid")+")$","i").test(escape(u)))return t.msg("不支持该音频格式",r),e.value="";break;default:if(!RegExp("\\w\\.("+(p||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(u)))return t.msg("不支持该图片格式",r),e.value=""}s.before&&s.before(e),l.parent().submit();var c=a("#"+n),f=setInterval(function(){var a;try{a=c.contents().find("body").text()}catch(i){t.msg("上传接口存在跨域",r),clearInterval(f)}if(a){clearInterval(f),c.contents().find("body").html("");try{a=JSON.parse(a)}catch(i){return a={},t.msg("请对上传接口返回JSON字符",r)}"function"==typeof s.success&&s.success(a,e)}},30);e.value=""}},e("upload",function(e){var a=new s(e=e||{});a.init()})}); -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/log/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 | 17 | 42 |
43 | 44 | 63 | <#include "/common/version.html"> 64 | 67 | 68 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/entity/SysSetting.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.entity; 2 | 3 | import com.baomidou.mybatisplus.activerecord.Model; 4 | import com.baomidou.mybatisplus.annotations.TableId; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.baomidou.mybatisplus.enums.IdType; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | *

12 | * 系统设置表 13 | *

14 | * 15 | * @author GaoJun.Zhou 16 | * @since 2017-06-30 17 | */ 18 | @TableName("sys_setting") 19 | public class SysSetting extends Model { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * 主键 25 | */ 26 | @TableId(type=IdType.UUID) 27 | private String Id; 28 | /** 29 | * KEY 30 | */ 31 | private String sysKey; 32 | /** 33 | * 名称 34 | */ 35 | private String sysName; 36 | /** 37 | * 值 38 | */ 39 | private String sysValue; 40 | /** 41 | * 排序 42 | */ 43 | private Integer sort; 44 | /** 45 | * 说明 46 | */ 47 | private String sysDesc; 48 | 49 | 50 | public String getId() { 51 | return Id; 52 | } 53 | 54 | public void setId(String Id) { 55 | this.Id = Id; 56 | } 57 | 58 | public String getSysKey() { 59 | return sysKey; 60 | } 61 | 62 | public void setSysKey(String sysKey) { 63 | this.sysKey = sysKey; 64 | } 65 | 66 | public String getSysName() { 67 | return sysName; 68 | } 69 | 70 | public void setSysName(String sysName) { 71 | this.sysName = sysName; 72 | } 73 | 74 | public String getSysValue() { 75 | return sysValue; 76 | } 77 | 78 | public void setSysValue(String sysValue) { 79 | this.sysValue = sysValue; 80 | } 81 | 82 | public Integer getSort() { 83 | return sort; 84 | } 85 | 86 | public void setSort(Integer sort) { 87 | this.sort = sort; 88 | } 89 | 90 | public String getSysDesc() { 91 | return sysDesc; 92 | } 93 | 94 | public void setSysDesc(String sysDesc) { 95 | this.sysDesc = sysDesc; 96 | } 97 | 98 | @Override 99 | protected Serializable pkVal() { 100 | return this.Id; 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/impl/SysMenuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service.impl; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.alex.admin.web.entity.SysMenu; 7 | import org.alex.admin.web.entity.SysRoleMenu; 8 | import org.alex.admin.web.mapper.SysMenuMapper; 9 | import org.alex.admin.web.mapper.SysRoleMenuMapper; 10 | import org.alex.admin.web.service.ISysMenuService; 11 | import org.alex.admin.web.util.BaseUtil; 12 | import org.apache.commons.lang.StringUtils; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Service; 15 | 16 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 17 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 18 | import com.google.common.base.Splitter; 19 | 20 | /** 21 | *

22 | * 菜单表 服务实现类 23 | *

24 | * 25 | * @author GaoJun.Zhou 26 | * @since 2017-06-30 27 | */ 28 | @Service 29 | public class SysMenuServiceImpl extends ServiceImpl implements ISysMenuService { 30 | 31 | @Autowired 32 | private SysRoleMenuMapper sysRoleMenuMapper; 33 | @Autowired 34 | private SysMenuMapper sysMenuMapper; 35 | 36 | /** 37 | * 分配权限 38 | */ 39 | @Override 40 | public void updateAuth(String roleId, String menuIds) { 41 | // TODO Auto-generated method stub 42 | 43 | sysRoleMenuMapper.delete(new EntityWrapper().eq("roleId", roleId)); 44 | if (StringUtils.isNotBlank(menuIds)) { 45 | List menuIdList = Splitter.on(",").splitToList(menuIds); 46 | for (String menuId : menuIdList) { 47 | SysRoleMenu roleMenu = new SysRoleMenu(); 48 | roleMenu.setId(BaseUtil.uuid()); 49 | roleMenu.setMenuId(menuId); 50 | roleMenu.setRoleId(roleId); 51 | sysRoleMenuMapper.insert(roleMenu); 52 | } 53 | } 54 | 55 | } 56 | 57 | @Override 58 | public List> selectMenuByUid(String uid, String pid) { 59 | // TODO Auto-generated method stub 60 | return sysMenuMapper.selectMenuByUid(uid, pid); 61 | } 62 | 63 | @Override 64 | public List selectResourceByUid(String uid) { 65 | // TODO Auto-generated method stub 66 | return sysMenuMapper.selectResourceByUid(uid); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/resources/spring/applicationContext-service.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.alex.admin.core.anno.PassLogin; 6 | import org.alex.admin.core.bean.Rest; 7 | import org.alex.admin.web.entity.SysUser; 8 | import org.alex.admin.web.service.ISysUserService; 9 | import org.alex.admin.web.util.BaseUtil; 10 | import org.apache.commons.lang.StringUtils; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.web.bind.annotation.GetMapping; 14 | import org.springframework.web.bind.annotation.PostMapping; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 18 | /** 19 | * 标准的Rest接口,实例控制器 20 | * Created by Gaojun.Zhou 2017年6月8日 21 | */ 22 | @Controller 23 | public class LoginController{ 24 | 25 | @Autowired private ISysUserService sysUserService; 26 | 27 | /** 28 | * 登录 29 | * @return 30 | */ 31 | @PassLogin 32 | @GetMapping("/login") 33 | public String login(){ 34 | return "login"; 35 | 36 | } 37 | 38 | /** 39 | * 执行登录 40 | * @param username 41 | * @param password 42 | * @param request 43 | * @return 44 | */ 45 | @PassLogin 46 | @ResponseBody 47 | @PostMapping("/doLogin") 48 | public Rest doLogin(String username,String password,HttpServletRequest request){ 49 | 50 | if(StringUtils.isBlank(username) || StringUtils.isBlank(password)){ 51 | throw new RuntimeException("用户名或密码不能为空"); 52 | } 53 | SysUser user = sysUserService.selectOne(new EntityWrapper().eq("userName",username).eq("password",BaseUtil.MD5(password))); 54 | if(user == null){ 55 | throw new RuntimeException("用户名或密码错误"); 56 | } 57 | if(user.getUserState() == -1){ 58 | throw new RuntimeException("该用户已锁定,请联系超级管理员"); 59 | } 60 | 61 | request.getSession().setAttribute("session_user",user); 62 | return Rest.ok("登录成功"); 63 | 64 | } 65 | 66 | /** 67 | * 注销 68 | * @return 69 | */ 70 | @PassLogin 71 | @GetMapping("/logout") 72 | public String logout(HttpServletRequest request){ 73 | request.getSession().invalidate(); 74 | return "redirect:login"; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/service/impl/SysUserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.service.impl; 2 | 3 | import org.alex.admin.web.entity.SysUser; 4 | import org.alex.admin.web.entity.SysUserRole; 5 | import org.alex.admin.web.mapper.SysUserMapper; 6 | import org.alex.admin.web.service.ISysUserRoleService; 7 | import org.alex.admin.web.service.ISysUserService; 8 | import org.alex.admin.web.util.BaseUtil; 9 | import org.apache.commons.lang.ArrayUtils; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 14 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 15 | 16 | /** 17 | *

18 | * 用户表 服务实现类 19 | *

20 | * 21 | * @author GaoJun.Zhou 22 | * @since 2017-06-30 23 | */ 24 | @Service 25 | public class SysUserServiceImpl extends ServiceImpl implements ISysUserService { 26 | 27 | @Autowired private ISysUserRoleService sysUserRoleService; 28 | 29 | @Override 30 | public void addUser(SysUser user, String[] roleIds) { 31 | // TODO Auto-generated method stub 32 | this.insert(user); 33 | if(!ArrayUtils.isEmpty(roleIds)){ 34 | for(String rid : roleIds){ 35 | SysUserRole ur = new SysUserRole(); 36 | ur.setRoleId(rid); 37 | ur.setId(BaseUtil.uuid()); 38 | ur.setUserId(user.getId()); 39 | sysUserRoleService.insert(ur); 40 | } 41 | 42 | } 43 | } 44 | 45 | @Override 46 | public void updateUser(SysUser user, String[] roleIds) { 47 | // TODO Auto-generated method stub 48 | this.updateById(user); 49 | sysUserRoleService.delete(new EntityWrapper().eq("userId",user.getId())); 50 | if(!ArrayUtils.isEmpty(roleIds)){ 51 | for(String rid : roleIds){ 52 | SysUserRole ur = new SysUserRole(); 53 | ur.setRoleId(rid); 54 | ur.setId(BaseUtil.uuid()); 55 | ur.setUserId(user.getId()); 56 | sysUserRoleService.insert(ur); 57 | } 58 | 59 | } 60 | 61 | } 62 | 63 | @Override 64 | public void deleteUser(String[] id) { 65 | // TODO Auto-generated method stub 66 | if(!ArrayUtils.isEmpty(id)){ 67 | for(String d : id){ 68 | this.deleteById(d); 69 | sysUserRoleService.delete(new EntityWrapper().eq("userId",d)); 70 | } 71 | } 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | restful-api-web 4 | 5 | 6 | encodingFilter 7 | org.springframework.web.filter.CharacterEncodingFilter 8 | 9 | encoding 10 | UTF-8 11 | 12 | 13 | forceEncoding 14 | true 15 | 16 | 17 | 18 | encodingFilter 19 | /* 20 | 21 | 22 | 23 | 24 | DruidStatView 25 | com.alibaba.druid.support.http.StatViewServlet 26 | 27 | resetEnable 28 | true 29 | 30 | 31 | 32 | DruidStatView 33 | /druid/* 34 | 35 | 36 | 37 | contextConfigLocation 38 | classpath:spring/applicationContext-*.xml 39 | 40 | 41 | org.springframework.web.context.ContextLoaderListener 42 | 43 | 44 | org.springframework.web.context.request.RequestContextListener 45 | 46 | 47 | spring-mvc 48 | org.springframework.web.servlet.DispatcherServlet 49 | 50 | contextConfigLocation 51 | classpath:spring/servlet-context.xml 52 | 53 | 1 54 | 55 | 56 | spring-mvc 57 | / 58 | 59 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/menu/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
8 | 9 |
10 | 11 |
12 | 13 |
14 |
15 |
16 | 17 |
18 | 19 |
20 |
21 |
22 | 23 |
24 | 25 |
26 |
27 |
28 | 29 |
30 | 31 |
32 |
33 |
34 | 35 |
36 | 37 |
38 |
39 |
40 | 41 |
42 | 43 |
44 |
45 |
46 |
47 | 48 | 49 |
50 |
51 |
52 | 55 | <#include "/common/version.html"> 56 | 59 | 60 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/controller/LogController.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.controller; 2 | 3 | import org.alex.admin.core.anno.Resource; 4 | import org.alex.admin.core.bean.Rest; 5 | import org.alex.admin.core.controller.CrudController; 6 | import org.alex.admin.web.entity.SysLog; 7 | import org.alex.admin.web.service.ISysLogService; 8 | import org.apache.commons.lang.StringUtils; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.Model; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 17 | import com.baomidou.mybatisplus.plugins.Page; 18 | /** 19 | * 标准的Rest接口,实例控制器 20 | * Created by Gaojun.Zhou 2017年6月8日 21 | */ 22 | @Controller 23 | @RequestMapping("/log") 24 | public class LogController extends CrudController{ 25 | 26 | @Autowired private ISysLogService sysLogService; 27 | 28 | 29 | /** 30 | * 分页查询日志 31 | * @param page 32 | * @param size 33 | * @param keyword 34 | * @param model 35 | * @return 36 | */ 37 | @Resource("listLog") 38 | @ResponseBody 39 | @RequestMapping("/page") 40 | public Rest page( 41 | @RequestParam (required = true,defaultValue="1") Integer page, 42 | @RequestParam (defaultValue="10")Integer size,String keyword,Model model){ 43 | 44 | EntityWrapper ew = new EntityWrapper(); 45 | if(StringUtils.isNotBlank(keyword)){ 46 | ew.like("logTitle", keyword).or().like("userName",keyword).or().like("logContent",keyword); 47 | } 48 | Page pageData = sysLogService.selectPage(new Page(page, size),ew); 49 | 50 | return Rest.okData(pageData); 51 | 52 | } 53 | 54 | /** 55 | * 查看参数 56 | * @param id 57 | * @return 58 | */ 59 | @ResponseBody 60 | @RequestMapping("/params") 61 | public String params(String id){ 62 | return sysLogService.selectById(id).getRequestParams(); 63 | } 64 | 65 | @Override 66 | public String getViewName() { 67 | // TODO Auto-generated method stub 68 | return "log"; 69 | } 70 | 71 | 72 | 73 | @Override 74 | public String getModelName() { 75 | // TODO Auto-generated method stub 76 | return "log"; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /layui-admin-web/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.alex 8 | layui-admin 9 | 0.0.1-SNAPSHOT 10 | 11 | layui-admin-web 12 | war 13 | layui-admin-web Maven Webapp 14 | http://maven.apache.org 15 | 16 | 17 | 18 | 19 | org.alex 20 | layui-admin-core 21 | 0.0.1-SNAPSHOT 22 | 23 | 24 | 25 | 26 | io.springfox 27 | springfox-swagger2 28 | 29 | 30 | io.springfox 31 | springfox-swagger-ui 32 | 33 | 34 | com.fasterxml 35 | classmate 36 | 37 | 38 | 39 | 40 | org.apache.velocity 41 | velocity 42 | test 43 | 44 | 45 | 46 | 47 | org.freemarker 48 | freemarker 49 | 50 | 51 | 52 | commons-fileupload 53 | commons-fileupload 54 | 55 | 56 | 57 | 58 | layui-admin-web 59 | 60 | 61 | 62 | src/main/java 63 | 64 | **/*.xml 65 | 66 | 67 | 68 | src/main/resources 69 | 70 | **/*.xml 71 | **/*.properties 72 | 73 | 74 | 75 | 76 | 77 | 78 | org.mortbay.jetty 79 | jetty-maven-plugin 80 | 8.1.16.v20140903 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/role/auth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 | 8 |
9 | 10 | 11 |
12 | 13 |
14 |
    15 |
    16 |
    17 |
    18 |
    19 |
    20 | 21 | 22 |
    23 |
    24 |
    25 | <#include "/common/version.html"> 26 | 27 | 28 | 31 | 72 | 73 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/log/LogAdvice.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.log; 2 | 3 | import java.lang.reflect.Method; 4 | import java.util.Date; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | import org.alex.admin.core.anno.Log; 9 | import org.alex.admin.core.util.IpUtil; 10 | import org.apache.log4j.Logger; 11 | import org.aspectj.lang.JoinPoint; 12 | import org.aspectj.lang.annotation.AfterReturning; 13 | import org.aspectj.lang.annotation.Aspect; 14 | import org.aspectj.lang.annotation.Pointcut; 15 | import org.aspectj.lang.reflect.MethodSignature; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Component; 18 | import org.springframework.web.context.request.RequestContextHolder; 19 | import org.springframework.web.context.request.ServletRequestAttributes; 20 | 21 | import com.google.gson.Gson; 22 | /** 23 | * 正常业务日志记录 24 | * @author Administrator 25 | * 26 | */ 27 | @Aspect 28 | @Component 29 | public class LogAdvice { 30 | 31 | public static final Logger logger = Logger.getLogger(LogAdvice.class); 32 | 33 | /** 34 | * 注入日志记录接口,若存在则记录日志,不存在就忽略 35 | */ 36 | @Autowired(required=false) LogApi logApi; 37 | 38 | @Pointcut("@annotation(org.alex.admin.core.anno.Log)") 39 | public void controllerAspect() { 40 | 41 | } 42 | /** 43 | * 当方法正常返回是执行 44 | * @param joinPoint 45 | */ 46 | @AfterReturning("controllerAspect()") 47 | public void doBefore(JoinPoint joinPoint) { 48 | 49 | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); 50 | Method method = methodSignature.getMethod(); 51 | Log log = method.getAnnotation(Log.class); 52 | if(log != null){ 53 | String logTitle = log.title(); 54 | String logContent = log.value(); 55 | logger.debug("logs:[logTitle:"+logTitle+"][logContent:"+logContent+"]"); 56 | if(logApi != null){ 57 | HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); 58 | LogBean logBean = new LogBean(); 59 | logBean.setLogTitle(logTitle); 60 | logBean.setLogTime(new Date()); 61 | logBean.setLogContent(logContent); 62 | logBean.setRequestMethod(request.getMethod()); 63 | logBean.setClientIp(IpUtil.getIpAddr(request)); 64 | logBean.setRequestParams(new Gson().toJson(request.getParameterMap())); 65 | logBean.setRequestUrl(request.getRequestURI()); 66 | logger.debug("logBean:"+logBean.toString()); 67 | logApi.log(logBean); 68 | }else{ 69 | logger.warn("LogApi not finish."); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/menu/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
    8 | 9 |
    10 | 11 |
    12 | 13 |
    14 |
    15 |
    16 | 17 |
    18 | 19 |
    20 |
    21 |
    22 | 23 |
    24 | 25 |
    26 |
    27 |
    28 | 29 |
    30 | 31 |
    32 |
    33 |
    34 | 35 |
    36 | 37 |
    38 |
    39 |
    40 | 41 |
    42 | 43 |
    44 |
    45 |
    46 |
    47 | 48 | 49 |
    50 |
    51 |
    52 | 55 | <#include "/common/version.html"> 56 | 59 | 60 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/log/LogBean.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.log; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * 日志对象 7 | * Created by Gaojun.Zhou 2017年6月20日 8 | */ 9 | public class LogBean { 10 | 11 | /** 12 | * 日志标题 13 | */ 14 | private String logTitle; 15 | /** 16 | * 日志内容 17 | */ 18 | private String logContent; 19 | /** 20 | * 客户端IP 21 | */ 22 | private String clientIp; 23 | /** 24 | * 日志时间 25 | */ 26 | private Date logTime; 27 | /** 28 | * 请求方法 29 | */ 30 | private String requestUrl; 31 | /** 32 | * 请求方法 33 | */ 34 | private String requestMethod; 35 | /** 36 | * 请求参数 37 | */ 38 | private String requestParams; 39 | 40 | /** 41 | * 其他数据 42 | */ 43 | private String other; 44 | 45 | public String getLogTitle() { 46 | return logTitle; 47 | } 48 | 49 | public void setLogTitle(String logTitle) { 50 | this.logTitle = logTitle; 51 | } 52 | 53 | public String getLogContent() { 54 | return logContent; 55 | } 56 | 57 | public void setLogContent(String logContent) { 58 | this.logContent = logContent; 59 | } 60 | 61 | public String getClientIp() { 62 | return clientIp; 63 | } 64 | 65 | public void setClientIp(String clientIp) { 66 | this.clientIp = clientIp; 67 | } 68 | 69 | public Date getLogTime() { 70 | return logTime; 71 | } 72 | 73 | public void setLogTime(Date logTime) { 74 | this.logTime = logTime; 75 | } 76 | 77 | 78 | public String getRequestParams() { 79 | return requestParams; 80 | } 81 | 82 | public void setRequestParams(String requestParams) { 83 | this.requestParams = requestParams; 84 | } 85 | 86 | public String getRequestMethod() { 87 | return requestMethod; 88 | } 89 | 90 | public void setRequestMethod(String requestMethod) { 91 | this.requestMethod = requestMethod; 92 | } 93 | 94 | public String getOther() { 95 | return other; 96 | } 97 | 98 | public void setOther(String other) { 99 | this.other = other; 100 | } 101 | 102 | public String getRequestUrl() { 103 | return requestUrl; 104 | } 105 | 106 | public void setRequestUrl(String requestUrl) { 107 | this.requestUrl = requestUrl; 108 | } 109 | 110 | @Override 111 | public String toString() { 112 | return "LogBean [logTitle=" + logTitle + ", logContent=" + logContent + ", clientIp=" + clientIp + ", logTime=" 113 | + logTime + ", requestUrl=" + requestUrl + ", requestMethod=" + requestMethod + ", requestParams=" 114 | + requestParams + ", other=" + other + "]"; 115 | } 116 | 117 | 118 | } 119 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/user/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
    8 |
    9 | 10 |
    11 | 12 |
    13 |
    14 |
    15 | 16 |
    17 | 18 |
    19 |
    20 |
    21 | 22 |
    23 | 24 |
    25 |
    26 |
    27 | 28 |
    29 | 30 |
    31 |
    32 |
    33 | 34 |
    35 | 36 | 37 |
    38 |
    39 |
    40 | 41 |
    42 | <#list roleList as role> 43 | 44 | 45 |
    46 |
    47 |
    48 | 49 |
    50 | 51 | 52 |
    53 |
    54 |
    55 |
    56 | 57 | 58 |
    59 |
    60 |
    61 | <#include "/common/version.html"> 62 | 65 | 66 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 | 8 |
    9 | 10 |
    11 |
    12 | 13 | 14 | 30 |
    31 |
    32 | 33 |
    34 |
    35 | 36 |

    你好!${session_user.userName!"游客"}, 欢迎登录

    37 |
    38 | 39 |
    40 | 41 |
    42 |
    43 |
      44 |
    • 后台首页
    • 45 |
    46 |
    47 |
    48 | 49 |
    50 |
    51 |
    52 |
    53 | 54 | 57 |
    58 | 59 | 60 |
    61 |
    62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/menu/add_item.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
    8 |
    9 | 10 |
    11 | 12 | 13 |
    14 |
    15 |
    16 | 17 |
    18 | 19 |
    20 |
    21 |
    22 | 23 |
    24 | 25 |
    26 |
    27 |
    28 | 29 |
    30 | 31 |
    32 |
    33 |
    34 | 35 |
    36 | 37 |
    38 |
    39 |
    40 | 41 |
    42 | 43 |
    44 |
    45 |
    46 | 47 |
    48 | 49 |
    50 |
    51 |
    52 |
    53 | 54 | 55 |
    56 |
    57 |
    58 | 61 | <#include "/common/version.html"> 62 | 65 | 66 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/json/images.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "imgSrc" : "../../images/userface1.jpg", 3 | "imgTitle" : "美女生活照1" 4 | },{ 5 | "imgSrc" : "../../images/userface2.jpg", 6 | "imgTitle" : "美女生活照2" 7 | },{ 8 | "imgSrc" : "../../images/userface3.jpg", 9 | "imgTitle" : "美女生活照3" 10 | },{ 11 | "imgSrc" : "../../images/userface4.jpg", 12 | "imgTitle" : "美女生活照4" 13 | },{ 14 | "imgSrc" : "../../images/userface5.jpg", 15 | "imgTitle" : "美女生活照5" 16 | },{ 17 | "imgSrc" : "../../images/userface1.jpg", 18 | "imgTitle" : "美女生活照6" 19 | },{ 20 | "imgSrc" : "../../images/userface2.jpg", 21 | "imgTitle" : "美女生活照7" 22 | },{ 23 | "imgSrc" : "../../images/userface3.jpg", 24 | "imgTitle" : "美女生活照8" 25 | },{ 26 | "imgSrc" : "../../images/userface4.jpg", 27 | "imgTitle" : "美女生活照9" 28 | },{ 29 | "imgSrc" : "../../images/userface5.jpg", 30 | "imgTitle" : "美女生活照10" 31 | },{ 32 | "imgSrc" : "../../images/userface1.jpg", 33 | "imgTitle" : "美女生活照11" 34 | },{ 35 | "imgSrc" : "../../images/userface2.jpg", 36 | "imgTitle" : "美女生活照12" 37 | },{ 38 | "imgSrc" : "../../images/userface3.jpg", 39 | "imgTitle" : "美女生活照13" 40 | },{ 41 | "imgSrc" : "../../images/userface4.jpg", 42 | "imgTitle" : "美女生活照14" 43 | },{ 44 | "imgSrc" : "../../images/userface5.jpg", 45 | "imgTitle" : "美女生活照15" 46 | },{ 47 | "imgSrc" : "../../images/userface1.jpg", 48 | "imgTitle" : "美女生活照16" 49 | },{ 50 | "imgSrc" : "../../images/userface2.jpg", 51 | "imgTitle" : "美女生活照17" 52 | },{ 53 | "imgSrc" : "../../images/userface3.jpg", 54 | "imgTitle" : "美女生活照18" 55 | },{ 56 | "imgSrc" : "../../images/userface4.jpg", 57 | "imgTitle" : "美女生活照19" 58 | },{ 59 | "imgSrc" : "../../images/userface5.jpg", 60 | "imgTitle" : "美女生活照20" 61 | },{ 62 | "imgSrc" : "../../images/userface1.jpg", 63 | "imgTitle" : "美女生活照21" 64 | },{ 65 | "imgSrc" : "../../images/userface2.jpg", 66 | "imgTitle" : "美女生活照22" 67 | },{ 68 | "imgSrc" : "../../images/userface3.jpg", 69 | "imgTitle" : "美女生活照23" 70 | },{ 71 | "imgSrc" : "../../images/userface4.jpg", 72 | "imgTitle" : "美女生活照24" 73 | },{ 74 | "imgSrc" : "../../images/userface5.jpg", 75 | "imgTitle" : "美女生活照25" 76 | },{ 77 | "imgSrc" : "../../images/userface1.jpg", 78 | "imgTitle" : "美女生活照26" 79 | },{ 80 | "imgSrc" : "../../images/userface2.jpg", 81 | "imgTitle" : "美女生活照27" 82 | },{ 83 | "imgSrc" : "../../images/userface3.jpg", 84 | "imgTitle" : "美女生活照28" 85 | },{ 86 | "imgSrc" : "../../images/userface4.jpg", 87 | "imgTitle" : "美女生活照29" 88 | },{ 89 | "imgSrc" : "../../images/userface5.jpg", 90 | "imgTitle" : "美女生活照30" 91 | },{ 92 | "imgSrc" : "../../images/userface3.jpg", 93 | "imgTitle" : "美女生活照31" 94 | }] -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/js/main.js: -------------------------------------------------------------------------------- 1 | layui.config({ 2 | base : "/js/" 3 | }).use(['form','element','layer','jquery'],function(){ 4 | var form = layui.form(), 5 | layer = parent.layer === undefined ? layui.layer : parent.layer, 6 | element = layui.element(), 7 | $ = layui.jquery; 8 | 9 | $(".panel a").on("click",function(){ 10 | window.parent.addTab($(this)); 11 | }) 12 | 13 | //动态获取文章总数和待审核文章数量,最新文章 14 | $.get("../json/newsList.json", 15 | function(data){ 16 | var waitNews = []; 17 | $(".allNews span").text(data.length); //文章总数 18 | for(var i=0;i'+data[i].newsName+'' 30 | +''+data[i].newsTime+'' 31 | +''; 32 | } 33 | $(".hot_news").html(hotNewsHtml); 34 | } 35 | ) 36 | 37 | //图片总数 38 | $.get("../json/images.json", 39 | function(data){ 40 | $(".imgAll span").text(data.length); 41 | } 42 | ) 43 | 44 | //用户数 45 | $.get("../json/usersList.json", 46 | function(data){ 47 | $(".userAll span").text(data.length); 48 | } 49 | ) 50 | 51 | //新消息 52 | $.get("../json/message.json", 53 | function(data){ 54 | $(".newMessage span").text(data.length); 55 | } 56 | ) 57 | 58 | 59 | //数字格式化 60 | $(".panel span").each(function(){ 61 | $(this).html($(this).text()>9999 ? ($(this).text()/10000).toFixed(2) + "" : $(this).text()); 62 | }) 63 | 64 | //系统基本参数 65 | if(window.sessionStorage.getItem("systemParameter")){ 66 | var systemParameter = JSON.parse(window.sessionStorage.getItem("systemParameter")); 67 | fillParameter(systemParameter); 68 | }else{ 69 | $.ajax({ 70 | url : "../json/systemParameter.json", 71 | type : "get", 72 | dataType : "json", 73 | success : function(data){ 74 | fillParameter(data); 75 | } 76 | }) 77 | } 78 | 79 | //填充数据方法 80 | function fillParameter(data){ 81 | //判断字段数据是否存在 82 | function nullData(data){ 83 | if(data == '' || data == "undefined"){ 84 | return "未定义"; 85 | }else{ 86 | return data; 87 | } 88 | } 89 | $(".version").text(nullData(data.version)); //当前版本 90 | $(".author").text(nullData(data.author)); //开发作者 91 | $(".homePage").text(nullData(data.homePage)); //网站首页 92 | $(".server").text(nullData(data.server)); //服务器环境 93 | $(".dataBase").text(nullData(data.dataBase)); //数据库版本 94 | $(".maxUpload").text(nullData(data.maxUpload)); //最大上传限制 95 | $(".userRights").text(nullData(data.userRights));//当前用户权限 96 | } 97 | 98 | }) 99 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/entity/SysMenu.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.entity; 2 | 3 | import com.baomidou.mybatisplus.activerecord.Model; 4 | import com.baomidou.mybatisplus.annotations.TableId; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.baomidou.mybatisplus.enums.IdType; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | *

    12 | * 菜单表 13 | *

    14 | * 15 | * @author GaoJun.Zhou 16 | * @since 2017-06-30 17 | */ 18 | @TableName("sys_menu") 19 | public class SysMenu extends Model { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * 主键 25 | */ 26 | @TableId(type=IdType.UUID) 27 | private String id; 28 | /** 29 | * 菜单名称 30 | */ 31 | private String menuName; 32 | /** 33 | * 父级菜单ID 34 | */ 35 | private String pid; 36 | /** 37 | * 连接地址 38 | */ 39 | private String url; 40 | /** 41 | * 图标 42 | */ 43 | private String icon; 44 | /** 45 | * 排序 46 | */ 47 | private Integer sort; 48 | /** 49 | * 深度 50 | */ 51 | private Integer deep; 52 | /** 53 | * 编码 54 | */ 55 | private String code; 56 | /** 57 | * 资源名称 58 | */ 59 | private String resource; 60 | 61 | 62 | public String getId() { 63 | return id; 64 | } 65 | 66 | public void setId(String id) { 67 | this.id = id; 68 | } 69 | 70 | public String getMenuName() { 71 | return menuName; 72 | } 73 | 74 | public void setMenuName(String menuName) { 75 | this.menuName = menuName; 76 | } 77 | 78 | public String getPid() { 79 | return pid; 80 | } 81 | 82 | public void setPid(String pid) { 83 | this.pid = pid; 84 | } 85 | 86 | public String getUrl() { 87 | return url; 88 | } 89 | 90 | public void setUrl(String url) { 91 | this.url = url; 92 | } 93 | 94 | public String getIcon() { 95 | return icon; 96 | } 97 | 98 | public void setIcon(String icon) { 99 | this.icon = icon; 100 | } 101 | 102 | public Integer getSort() { 103 | return sort; 104 | } 105 | 106 | public void setSort(Integer sort) { 107 | this.sort = sort; 108 | } 109 | 110 | public Integer getDeep() { 111 | return deep; 112 | } 113 | 114 | public void setDeep(Integer deep) { 115 | this.deep = deep; 116 | } 117 | 118 | public String getCode() { 119 | return code; 120 | } 121 | 122 | public void setCode(String code) { 123 | this.code = code; 124 | } 125 | 126 | public String getResource() { 127 | return resource; 128 | } 129 | 130 | public void setResource(String resource) { 131 | this.resource = resource; 132 | } 133 | 134 | @Override 135 | protected Serializable pkVal() { 136 | return this.id; 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/entity/SysUser.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import org.hibernate.validator.constraints.Length; 7 | import org.hibernate.validator.constraints.NotBlank; 8 | import org.hibernate.validator.constraints.NotEmpty; 9 | 10 | import com.baomidou.mybatisplus.activerecord.Model; 11 | import com.baomidou.mybatisplus.annotations.TableId; 12 | import com.baomidou.mybatisplus.annotations.TableName; 13 | import com.baomidou.mybatisplus.enums.IdType; 14 | 15 | /** 16 | *

    17 | * 用户表 18 | *

    19 | * 20 | * @author GaoJun.Zhou 21 | * @since 2017-06-30 22 | */ 23 | @TableName("sys_user") 24 | public class SysUser extends Model { 25 | 26 | private static final long serialVersionUID = 1L; 27 | 28 | /** 29 | * 主键 30 | */ 31 | @TableId(type=IdType.UUID) 32 | private String id; 33 | /** 34 | * 用户名 35 | */ 36 | @NotEmpty(message = "用户名不能为空") 37 | private String userName; 38 | /** 39 | * 密码 40 | */ 41 | @NotBlank(message="密码不能为空") 42 | @Length(min = 6, max = 16, message = "密码长度为6-16之间") 43 | private String password; 44 | /** 45 | * 用户状态,1-启用,-1禁用 46 | */ 47 | private Integer userState; 48 | /** 49 | * 创建时间 50 | */ 51 | private Date createTime; 52 | /** 53 | * 描述 54 | */ 55 | private String userDesc; 56 | /** 57 | * 头像 58 | */ 59 | private String userImg; 60 | 61 | 62 | public String getId() { 63 | return id; 64 | } 65 | 66 | public void setId(String id) { 67 | this.id = id; 68 | } 69 | 70 | public String getUserName() { 71 | return userName; 72 | } 73 | 74 | public void setUserName(String userName) { 75 | this.userName = userName; 76 | } 77 | 78 | public String getPassword() { 79 | return password; 80 | } 81 | 82 | public void setPassword(String password) { 83 | this.password = password; 84 | } 85 | 86 | public Integer getUserState() { 87 | return userState; 88 | } 89 | 90 | public void setUserState(Integer userState) { 91 | this.userState = userState; 92 | } 93 | 94 | public Date getCreateTime() { 95 | return createTime; 96 | } 97 | 98 | public void setCreateTime(Date createTime) { 99 | this.createTime = createTime; 100 | } 101 | 102 | public String getUserDesc() { 103 | return userDesc; 104 | } 105 | 106 | public void setUserDesc(String userDesc) { 107 | this.userDesc = userDesc; 108 | } 109 | 110 | public String getUserImg() { 111 | return userImg; 112 | } 113 | 114 | public void setUserImg(String userImg) { 115 | this.userImg = userImg; 116 | } 117 | 118 | @Override 119 | protected Serializable pkVal() { 120 | return this.id; 121 | } 122 | 123 | } 124 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/controller/CrudController.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.controller; 2 | 3 | import java.io.Serializable; 4 | import java.util.Arrays; 5 | 6 | import org.alex.admin.core.bean.Rest; 7 | import org.alex.admin.core.ex.NotFindDataException; 8 | import org.apache.commons.lang.ArrayUtils; 9 | import org.apache.commons.lang.StringUtils; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.ui.Model; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import com.baomidou.mybatisplus.service.IService; 17 | 18 | /** 19 | * Rest CRUD 超级控制器,目的在于所有继承该控制器的子控制器自带标准的5个Rest接口,包含CRUD 20 | * Created by Gaojun.Zhou 2017年6月8日 21 | * 22 | * T 表示要操作的实体,实现序列化接口Serializable 23 | * S 表示调用对象的服务层接口,一班情况下要求存在 24 | * 25 | */ 26 | public abstract class CrudController> { 27 | /** 28 | * 注入服务层 29 | */ 30 | @Autowired(required = false) private S s; 31 | 32 | public S getS() { 33 | return s; 34 | } 35 | 36 | /** 37 | * 请求跳转到当前页面业务的list页面 38 | * @return 39 | */ 40 | @GetMapping({"","/","list"}) 41 | public String list(){ 42 | return getViewName() + "/list" ; 43 | } 44 | 45 | /** 46 | * 增加 47 | * @return 48 | */ 49 | @GetMapping("/add") 50 | public String add(Model model){ 51 | return getViewName() + "/add" ; 52 | } 53 | 54 | /** 55 | * 编辑 56 | * @param id 57 | * @param model 58 | * @return 59 | */ 60 | @GetMapping("/edit") 61 | public String edit(String id,Model model){ 62 | 63 | if(StringUtils.isBlank((String)id)){ 64 | throw new RuntimeException("参数{id}不能为空"); 65 | } 66 | T t = s.selectById(id); 67 | if(t != null){ 68 | model.addAttribute(getModelName(), t); 69 | return getViewName() + "/edit" ; 70 | } 71 | throw new NotFindDataException(String.format("id为[%s]的对象不存在",id)); 72 | } 73 | 74 | /** 75 | * 删除对象,可批量删除 76 | * @param id 77 | * @return 78 | */ 79 | @ResponseBody 80 | @RequestMapping("/delete") 81 | public Rest delete( String[] id){ 82 | 83 | boolean b = true; 84 | 85 | if(ArrayUtils.isEmpty(id)){ 86 | throw new RuntimeException("参数{id}不能为空"); 87 | }else{ 88 | b = s.deleteBatchIds(Arrays.asList(id)); 89 | } 90 | return b ? Rest.ok("删除成功") : Rest.failure("糟糕,删除失败"); 91 | } 92 | 93 | /** 94 | * 获取模板名称 95 | * @return 96 | */ 97 | public abstract String getViewName(); 98 | /** 99 | * 获取模型名称 100 | * @return 101 | */ 102 | public abstract String getModelName(); 103 | } 104 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/util/IpUtil.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.util; 2 | 3 | import java.net.InetAddress; 4 | import java.net.UnknownHostException; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | import org.apache.log4j.Logger; 9 | 10 | /** 11 | * IP工具类 12 | * Created by Gaojun.Zhou 2017年6月22日 13 | */ 14 | public class IpUtil { 15 | 16 | 17 | private static final Logger logger = Logger.getLogger("IpHelper"); 18 | 19 | private static String LOCAL_IP_STAR_STR = "192.168."; 20 | 21 | static { 22 | String ip = null; 23 | String hostName = null; 24 | try { 25 | hostName = InetAddress.getLocalHost().getHostName(); 26 | InetAddress ipAddr[] = InetAddress.getAllByName(hostName); 27 | for (int i = 0; i < ipAddr.length; i++) { 28 | ip = ipAddr[i].getHostAddress(); 29 | if (ip.startsWith(LOCAL_IP_STAR_STR)) { 30 | break; 31 | } 32 | } 33 | if (ip == null) { 34 | ip = ipAddr[0].getHostAddress(); 35 | } 36 | 37 | } catch (UnknownHostException e) { 38 | logger.error("IpHelper error."); 39 | e.printStackTrace(); 40 | } 41 | 42 | LOCAL_IP = ip; 43 | HOST_NAME = hostName; 44 | 45 | } 46 | 47 | /** 系统的本地IP地址 */ 48 | public static final String LOCAL_IP; 49 | 50 | /** 系统的本地服务器名 */ 51 | public static final String HOST_NAME; 52 | 53 | /** 54 | *

    55 | * 获取客户端的IP地址的方法是:request.getRemoteAddr(),这种方法在大部分情况下都是有效的。 56 | * 但是在通过了Apache,Squid等反向代理软件就不能获取到客户端的真实IP地址了,如果通过了多级反向代理的话, 57 | * X-Forwarded-For的值并不止一个,而是一串IP值, 究竟哪个才是真正的用户端的真实IP呢? 58 | * 答案是取X-Forwarded-For中第一个非unknown的有效IP字符串。 59 | * 例如:X-Forwarded-For:192.168.1.110, 192.168.1.120, 60 | * 192.168.1.130, 192.168.1.100 用户真实IP为: 192.168.1.110 61 | *

    62 | * 63 | * @param request 64 | * @return 65 | */ 66 | public static String getIpAddr(HttpServletRequest request) { 67 | String ip = request.getHeader("x-forwarded-for"); 68 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 69 | ip = request.getHeader("Proxy-Client-IP"); 70 | } 71 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 72 | ip = request.getHeader("WL-Proxy-Client-IP"); 73 | } 74 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 75 | ip = request.getRemoteAddr(); 76 | if (ip.equals("127.0.0.1")) { 77 | /** 根据网卡取本机配置的IP */ 78 | InetAddress inet = null; 79 | try { 80 | inet = InetAddress.getLocalHost(); 81 | ip = inet.getHostAddress(); 82 | } catch (UnknownHostException e) { 83 | logger.error("IpHelper error." + e.toString()); 84 | } 85 | } 86 | } 87 | /** 88 | * 对于通过多个代理的情况, 第一个IP为客户端真实IP,多个IP按照','分割 "***.***.***.***".length() = 89 | * 15 90 | */ 91 | if (ip != null && ip.length() > 15) { 92 | if (ip.indexOf(",") > 0) { 93 | ip = ip.substring(0, ip.indexOf(",")); 94 | } 95 | } 96 | return ip; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/util/BaseUtil.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.util; 2 | 3 | import java.io.IOException; 4 | import java.security.MessageDigest; 5 | import java.util.UUID; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import com.google.gson.Gson; 11 | 12 | /** 13 | * 常用工具了 Created by Gaojun.Zhou 2017年7月3日 14 | */ 15 | public class BaseUtil { 16 | 17 | 18 | /** 19 | * 转换为JSON字符串 20 | * 21 | * @param object 22 | * @return 23 | */ 24 | public static String toJson(Object object) { 25 | // TODO Auto-generated method stub 26 | if (object != null) { 27 | return new Gson().toJson(object); 28 | } 29 | return ""; 30 | } 31 | 32 | /** 33 | * UUID 34 | * 35 | * @return 36 | */ 37 | public static String uuid() { 38 | // TODO Auto-generated method stub 39 | return UUID.randomUUID().toString().replaceAll("-", "").toLowerCase(); 40 | } 41 | 42 | /** 43 | * MD5 44 | * 45 | * @param pwd 46 | * @return 47 | */ 48 | public static String MD5(String pwd) { 49 | // 用于加密的字符 50 | char md5String[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; 51 | try { 52 | // 使用平台的默认字符集将此 String 编码为 byte序列,并将结果存储到一个新的 byte数组中 53 | byte[] btInput = pwd.getBytes(); 54 | 55 | // 信息摘要是安全的单向哈希函数,它接收任意大小的数据,并输出固定长度的哈希值。 56 | MessageDigest mdInst = MessageDigest.getInstance("MD5"); 57 | 58 | // MessageDigest对象通过使用 update方法处理数据, 使用指定的byte数组更新摘要 59 | mdInst.update(btInput); 60 | 61 | // 摘要更新之后,通过调用digest()执行哈希计算,获得密文 62 | byte[] md = mdInst.digest(); 63 | 64 | // 把密文转换成十六进制的字符串形式 65 | int j = md.length; 66 | char str[] = new char[j * 2]; 67 | int k = 0; 68 | for (int i = 0; i < j; i++) { // i = 0 69 | byte byte0 = md[i]; // 95 70 | str[k++] = md5String[byte0 >>> 4 & 0xf]; // 5 71 | str[k++] = md5String[byte0 & 0xf]; // F 72 | } 73 | 74 | // 返回经过加密后的字符串 75 | return new String(str); 76 | 77 | } catch (Exception e) { 78 | return null; 79 | } 80 | } 81 | 82 | /** 83 | * 验证是否为Ajax 84 | * @param request 85 | * @return 86 | */ 87 | public static boolean isAjax( HttpServletRequest request ) { 88 | return "XMLHttpRequest".equals(request.getHeader("X-Requested-With")) ? true : false; 89 | } 90 | 91 | /** 92 | * 重定向 93 | * @param request 94 | * @param response 95 | */ 96 | public static void clearRedirectLogin(HttpServletRequest request,HttpServletResponse response){ 97 | try { 98 | request.getSession().invalidate(); 99 | response.sendRedirect("/login"); 100 | } catch (IOException e) { 101 | // TODO Auto-generated catch block 102 | e.printStackTrace(); 103 | } 104 | } 105 | 106 | public static void main(String[] args) { 107 | System.out.println(uuid()); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/lay/modules/tree.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9_rls MIT License By http://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var o=layui.jquery,a=layui.hint(),r="layui-tree-enter",i=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};i.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},i.prototype.tree=function(e,a){var r=this,i=r.options,n=a||i.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
      '),s=o(["
    • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return i.check?''+("checkbox"===i.check?t.checkbox[0]:"radio"===i.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
    • "].join(""));l&&(s.append(c),r.tree(c,n.children)),e.append(s),"function"==typeof i.click&&r.click(s,n),r.spread(s,n),i.drag&&r.drag(s,n)})},i.prototype.click=function(e,o){var a=this,r=a.options;e.children("a").on("click",function(e){layui.stope(e),r.click(o)})},i.prototype.spread=function(e,o){var a=this,r=(a.options,e.children(".layui-tree-spread")),i=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),i.removeClass("layui-show"),r.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),i.addClass("layui-show"),r.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};i[0]&&(r.on("click",l),n.on("dblclick",l))},i.prototype.on=function(e){var a=this,i=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),i.drag&&o(document).on("mousemove",function(e){var r=a.move;if(r.from){var i=(r.to,o('
      '));e.preventDefault(),o("."+t)[0]||o("body").append(i);var n=o("."+t)[0]?o("."+t):i;n.addClass("layui-show").html(r.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(r),e.to&&e.to.elem.children("a").removeClass(r),a.move={},o("."+t).remove())})},i.prototype.move={},i.prototype.drag=function(e,a){var i=this,t=(i.options,e.children("a")),n=function(){var t=o(this),n=i.move;n.from&&(n.to={item:a,elem:e},t.addClass(r))};t.on("mousedown",function(){var o=i.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=i.move;a.from&&(delete a.to,e.removeClass(r))})},e("tree",function(e){var r=new i(e=e||{}),t=o(e.elem);return t[0]?void r.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/menu/edit_item.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
      8 | 9 |
      10 | 11 |
      12 | 13 | 14 |
      15 |
      16 |
      17 | 18 |
      19 | 20 |
      21 |
      22 |
      23 | 24 |
      25 | 26 |
      27 |
      28 |
      29 | 30 |
      31 | 32 |
      33 |
      34 |
      35 | 36 |
      37 | 38 |
      39 |
      40 |
      41 | 42 |
      43 | 44 |
      45 |
      46 |
      47 | 48 |
      49 | 50 |
      51 |
      52 |
      53 |
      54 | 55 | 56 |
      57 |
      58 |
      59 | 62 | <#include "/common/version.html"> 63 | 66 | 67 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/controller/FileUploadController.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.controller; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.Date; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | import org.alex.admin.core.anno.Log; 14 | import org.apache.commons.io.FileUtils; 15 | import org.apache.commons.io.FilenameUtils; 16 | import org.apache.commons.lang.RandomStringUtils; 17 | import org.apache.commons.lang.time.DateFormatUtils; 18 | import org.apache.log4j.Logger; 19 | import org.springframework.stereotype.Controller; 20 | import org.springframework.web.bind.annotation.RequestMapping; 21 | import org.springframework.web.bind.annotation.RequestParam; 22 | import org.springframework.web.bind.annotation.ResponseBody; 23 | import org.springframework.web.multipart.MultipartFile; 24 | 25 | /** 26 | * 文件上传控制器 27 | * Created by Gaojun.Zhou 2017年4月28日 28 | */ 29 | 30 | @Controller 31 | public class FileUploadController{ 32 | 33 | public static final Logger logger = Logger.getLogger(FileUploadController.class); 34 | 35 | /** 36 | * 上传文件 37 | * @param file 38 | * @return 39 | * @throws IOException 40 | */ 41 | @Log("文件上传") 42 | @ResponseBody 43 | @RequestMapping("/file/upload") 44 | public Map fileUpload( @RequestParam MultipartFile[] file,HttpServletRequest request) throws IOException{ 45 | 46 | List urls = new ArrayList(); 47 | Map result = new HashMap(); 48 | 49 | try { 50 | for(MultipartFile myfile : file){ 51 | if(myfile.isEmpty()){ 52 | logger.warn("文件未上传"); 53 | }else{ 54 | logger.debug("文件长度: " + myfile.getSize()); 55 | logger.debug("文件类型: " + myfile.getContentType()); 56 | logger.debug("文件名称: " + myfile.getName()); 57 | logger.debug("文件原名: " + myfile.getOriginalFilename()); 58 | String ext = FilenameUtils.getExtension(myfile.getOriginalFilename()); 59 | String reName = RandomStringUtils.randomAlphanumeric(32).toLowerCase() + "."+ ext; 60 | String cdate = DateFormatUtils.format(new Date(), "yyyy-MM-dd"); 61 | String realPath = request.getSession().getServletContext().getRealPath("/upload")+ File.separator +cdate; 62 | FileUtils.copyInputStreamToFile(myfile.getInputStream(), new File(realPath, reName)); 63 | urls.add("/upload/"+cdate+"/"+reName); 64 | } 65 | } 66 | result.put("status", 200); 67 | result.put("url",urls.get(0)); //如果是一个文件返回url 68 | result.put("urls",urls); //多个返回urls 69 | return result; 70 | } catch (Exception e) { 71 | // TODO Auto-generated catch block 72 | e.printStackTrace(); 73 | result.put("status", 500); 74 | result.put("status", e.getMessage()); 75 | return result; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/user/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 |
      8 | 9 |
      10 | 11 |
      12 | 13 |
      14 |
      15 |
      16 | 17 |
      18 | 19 |
      20 |
      21 |
      22 | 23 |
      24 | 25 |
      26 |
      27 |
      28 | 29 |
      30 | 31 |
      32 |
      33 |
      34 | 35 |
      36 | <#if user.userState==1> 37 | 38 | 39 | <#else> 40 | 41 | 42 | 43 | 44 |
      45 |
      46 |
      47 | 48 |
      49 | <#list roleList as role> 50 | <#if userRoleList?seq_contains(role.id)> 51 | 52 | <#else> 53 | 54 | 55 | 56 |
      57 |
      58 |
      59 | 60 |
      61 | 62 | 63 |
      64 |
      65 |
      66 |
      67 | 68 | 69 |
      70 |
      71 |
      72 | <#include "/common/version.html"> 73 | 76 | 77 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/user/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 | 23 | 48 |
      49 | 50 | 71 | <#include "/common/version.html"> 72 | 75 | 76 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/role/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 | 23 | 44 |
      45 | 46 | 66 | <#include "/common/version.html"> 67 | 70 | 71 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/static/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9_rls MIT License By http://www.layui.com */ 2 | ;layui.define(function(a){"use strict";function t(a){new p(a)}var e=document,r="getElementById",n="getElementsByTagName",s=0,p=function(a){var t=this,e=t.config=a||{};e.item=s++,t.render(!0)};p.on=function(a,t,e){return a.attachEvent?a.attachEvent("on"+t,function(){e.call(a,window.even)}):a.addEventListener(t,e,!1),p},p.prototype.type=function(){var a=this.config;if("object"==typeof a.cont)return void 0===a.cont.length?2:3},p.prototype.view=function(){var a=this,t=a.config,e=[],r={};if(t.pages=0|t.pages,t.curr=0|t.curr||1,t.groups="groups"in t?0|t.groups:5,t.first="first"in t?t.first:"首页",t.last="last"in t?t.last:"末页",t.prev="prev"in t?t.prev:"上一页",t.next="next"in t?t.next:"下一页",t.pages<=1)return"";for(t.groups>t.pages&&(t.groups=t.pages),r.index=Math.ceil((t.curr+(t.groups>1&&t.groups!==t.pages?1:0))/(0===t.groups?1:t.groups)),t.curr>1&&t.prev&&e.push(''+t.prev+""),r.index>1&&t.first&&0!==t.groups&&e.push(''+t.first+""),r.poor=Math.floor((t.groups-1)/2),r.start=r.index>1?t.curr-r.poor:1,r.end=r.index>1?function(){var a=t.curr+(t.groups-r.poor-1);return a>t.pages?t.pages:a}():t.groups,r.end-r.start"+r.start+""):e.push(''+r.start+"");return t.pages>t.groups&&r.end'+t.last+""),r.flow=!t.prev&&0===t.groups,(t.curr!==t.pages&&t.next||r.flow)&&e.push(function(){return r.flow&&t.curr===t.pages?''+t.next+"":''+t.next+""}()),'
      '+e.join("")+function(){return t.skip?'到第 ':""}()+"
      "},p.prototype.jump=function(a){if(a){for(var t=this,e=t.config,r=a.children,s=a[n]("button")[0],i=a[n]("input")[0],u=0,o=r.length;u 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 | 23 | 52 |
      53 | 54 | 83 | <#include "/common/version.html"> 84 | 87 | 88 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/java/org/alex/admin/web/entity/SysLog.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.web.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import com.baomidou.mybatisplus.activerecord.Model; 7 | import com.baomidou.mybatisplus.annotations.TableId; 8 | import com.baomidou.mybatisplus.annotations.TableName; 9 | import com.baomidou.mybatisplus.enums.IdType; 10 | 11 | /** 12 | *

      13 | * 日志表 14 | *

      15 | * 16 | * @author GaoJun.Zhou 17 | * @since 2017-07-06 18 | */ 19 | @TableName("sys_log") 20 | public class SysLog extends Model { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * 主键 26 | */ 27 | @TableId(type=IdType.UUID) 28 | private String id; 29 | /** 30 | * 用户 31 | */ 32 | private String userName; 33 | /** 34 | * 日志标题 35 | */ 36 | private String logTitle; 37 | /** 38 | * 日志内容 39 | */ 40 | private String logContent; 41 | /** 42 | * 客户端IP 43 | */ 44 | private String clientIp; 45 | /** 46 | * 请求URL 47 | */ 48 | private String requestUrl; 49 | /** 50 | * 请求方式 51 | */ 52 | private String requestMethod; 53 | /** 54 | * 参数 55 | */ 56 | private String requestParams; 57 | /** 58 | * 日志时间 59 | */ 60 | private Date logTime; 61 | /** 62 | * 备用 63 | */ 64 | private String other; 65 | 66 | 67 | public String getId() { 68 | return id; 69 | } 70 | 71 | public void setId(String id) { 72 | this.id = id; 73 | } 74 | 75 | public String getUserName() { 76 | return userName; 77 | } 78 | 79 | public void setUserName(String userName) { 80 | this.userName = userName; 81 | } 82 | 83 | public String getLogTitle() { 84 | return logTitle; 85 | } 86 | 87 | public void setLogTitle(String logTitle) { 88 | this.logTitle = logTitle; 89 | } 90 | 91 | public String getLogContent() { 92 | return logContent; 93 | } 94 | 95 | public void setLogContent(String logContent) { 96 | this.logContent = logContent; 97 | } 98 | 99 | public String getClientIp() { 100 | return clientIp; 101 | } 102 | 103 | public void setClientIp(String clientIp) { 104 | this.clientIp = clientIp; 105 | } 106 | 107 | public String getRequestUrl() { 108 | return requestUrl; 109 | } 110 | 111 | public void setRequestUrl(String requestUrl) { 112 | this.requestUrl = requestUrl; 113 | } 114 | 115 | public String getRequestMethod() { 116 | return requestMethod; 117 | } 118 | 119 | public void setRequestMethod(String requestMethod) { 120 | this.requestMethod = requestMethod; 121 | } 122 | 123 | public String getRequestParams() { 124 | return requestParams; 125 | } 126 | 127 | public void setRequestParams(String requestParams) { 128 | this.requestParams = requestParams; 129 | } 130 | 131 | public Date getLogTime() { 132 | return logTime; 133 | } 134 | 135 | public void setLogTime(Date logTime) { 136 | this.logTime = logTime; 137 | } 138 | 139 | public String getOther() { 140 | return other; 141 | } 142 | 143 | public void setOther(String other) { 144 | this.other = other; 145 | } 146 | 147 | @Override 148 | protected Serializable pkVal() { 149 | return this.id; 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /layui-admin-web/src/main/webapp/WEB-INF/views/pages/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <#include "/common/header.html"> 5 | 6 | 7 | 8 | 77 | 78 |
      79 |
      80 |
      系统介绍
      81 |
      82 |

      1. Layui-Admin权限管理系统

      83 |

      2. Github地址:https://github.com/zhougaojun618/layui-admin 84 |
      85 |

      86 |
      87 |
      88 |
      89 |
      90 |
      技术架构
      91 |
      92 |

      前台: Layui,Jquery

      93 |

      后台: SpringMVC、Mybatis、Mybatis-plus、Freemarker

      94 |

      数据库: Mysql

      95 |

      工具: Eclipse、Maven、Git

      96 |
      97 |
      98 |
      99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /layui-admin-core/src/main/java/org/alex/admin/core/bean/Rest.java: -------------------------------------------------------------------------------- 1 | package org.alex.admin.core.bean; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * 相应消息对象 9 | * Created by Gaojun.Zhou 2017年6月8日 10 | */ 11 | 12 | public class Rest { 13 | 14 | private int status; 15 | 16 | private boolean render; 17 | 18 | private String msg; 19 | 20 | private Object data; 21 | 22 | private Integer pages; 23 | 24 | private String url; 25 | 26 | private String details; 27 | 28 | public int getStatus() { 29 | return status; 30 | } 31 | 32 | public void setStatus(int status) { 33 | this.status = status; 34 | } 35 | 36 | public boolean isRender() { 37 | return render; 38 | } 39 | 40 | public void setRender(boolean render) { 41 | this.render = render; 42 | } 43 | 44 | public String getMsg() { 45 | return msg; 46 | } 47 | 48 | public void setMsg(String msg) { 49 | this.msg = msg; 50 | } 51 | 52 | public Object getData() { 53 | return data; 54 | } 55 | 56 | public void setData(Object data) { 57 | this.data = data; 58 | } 59 | 60 | public Integer getPages() { 61 | return pages; 62 | } 63 | 64 | public void setPages(Integer pages) { 65 | this.pages = pages; 66 | } 67 | 68 | public String getUrl() { 69 | return url; 70 | } 71 | 72 | public void setUrl(String url) { 73 | this.url = url; 74 | } 75 | 76 | public String getDetails() { 77 | return details; 78 | } 79 | 80 | public void setDetails(String details) { 81 | this.details = details; 82 | } 83 | 84 | public Rest(int status, boolean render, String msg, Object data, Integer pages, String url, String details) { 85 | super(); 86 | this.status = status; 87 | this.render = render; 88 | this.msg = msg; 89 | this.data = data; 90 | this.pages = pages; 91 | this.url = url; 92 | this.details = details; 93 | } 94 | 95 | 96 | 97 | public Rest() { 98 | super(); 99 | // TODO Auto-generated constructor stub 100 | } 101 | 102 | public static Rest ok(){ 103 | Rest rest = new Rest(); 104 | rest.setStatus(200); 105 | rest.setMsg("操作成功"); 106 | return rest; 107 | } 108 | 109 | public static Rest ok(String msg){ 110 | Rest rest = ok(); 111 | rest.setMsg(msg); 112 | return rest; 113 | } 114 | 115 | public static Rest ok(String msg,String url){ 116 | Rest rest = ok(); 117 | rest.setMsg(msg); 118 | rest.setUrl(url); 119 | return rest; 120 | } 121 | 122 | public static Rest okReload(String msg){ 123 | Rest rest = ok(); 124 | rest.setMsg(msg); 125 | rest.setUrl("reload"); 126 | return rest; 127 | } 128 | 129 | public static Rest okData(Object data){ 130 | Rest rest = ok(); 131 | rest.setData(data); 132 | return rest; 133 | } 134 | 135 | public static Rest okList(List list,int pages){ 136 | Rest rest = ok(); 137 | Map map = new HashMap(); 138 | map.put("list", list); 139 | rest.setData(map); 140 | rest.setPages(pages); 141 | return rest; 142 | } 143 | 144 | public static Rest failure(int status,String msg,Object data,String details){ 145 | Rest rest = new Rest(); 146 | rest.setStatus(status); 147 | rest.setMsg(msg); 148 | rest.setData(data); 149 | rest.setDetails(details); 150 | return rest; 151 | } 152 | 153 | public static Rest failure(String msg){ 154 | Rest rest = new Rest(); 155 | rest.setStatus(500); 156 | rest.setMsg(msg); 157 | return rest; 158 | } 159 | 160 | } 161 | --------------------------------------------------------------------------------