1 Star 0 Fork 3

LIU_SG_FLY / web-rbac0

forked from dangsj / web-rbac0 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

介绍

基于rbac0权限设计的后台管理系统,包含了登录、忘记密码、工作台[欢迎页/服务器监控]、组织管理、用户管理、角色管理、菜单管理、数据字典、异常消息、日志管理、数据库工具、个人资料、安全中心等功能;

通过在pom.xml中引入构件,即可快速地搭建起一套基础的后台管理系统。

集成了json api快速开发组件和xml接口校验组件,简化了持久化层开发步骤,封装一系列满足日常web开发使用的工具类;

登录

忘记密码

忘记密码

工作台

工作台

工作台

工作台

工作台

组织管理

用户管理

角色管理

菜单管理

数据字典

异常消息

日志管理

数据库管理

数据库管理

个人资料

安全中心

软件架构

该系统主要构件为web-system-rbac0 1.0.2.RELEASE,该构件中包含了如下第三方依赖:
spring-boot 2.0.0.RELEASE
mybatis-starter 2.0.0
beetl 2.9.3
fastjson 1.2.31
kaptcha 0.0.9

前端主要使用了Vue 2.6* + element-ui 2.13*

数据库采用mysql 5.7。

安装教程

仅需下面三步

1、pom.xml引用

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.0.0.RELEASE</version>
	</parent>
……
	<dependency>
		<groupId>com.qsyout</groupId>
		<artifactId>web-system-rbac0</artifactId>
		<version>1.0.7.RELEASE</version>
	</dependency>

2、数据库初始化:
main方法中执行如下代码:

PlatformBuilder.build(...).execute();

3、配置完数据库连接即可按照spring-boot 2.0.0.RELEASE项目的使用方式进行启动部署。

使用说明

1、配置文件的使用说明
com.qsyout.sdk.log.path=logback日志文件存放路径
com.qsyout.sdk.mail.host=邮件服务器地址,推荐使用[smtp.163.com]
com.qsyout.sdk.mail.userName=账户名
com.qsyout.sdk.mail.password=账户密码
com.qsyout.sdk.mail.encoding=UTF-8
com.qsyout.sdk.mail.alias=邮件别称
com.qsyout.sdk.mail.admin=管理员邮箱地址 发生系统错误时,会将异常错误信息的堆栈发送到管理员邮箱
com.qsyout.sdk.sync.dao.threads=10,使用多线程的形式查询数据库,查询连接池的数量,默认10
com.qsyout.settings.title=页面title
com.qsyout.settings.headerTitle=页面logo内容,默认为后台管理系统
com.qsyout.monitor.io.during=3服务器统计磁盘和网卡使用情况的间隔

2、注解的使用说明
@Api 标注在请求的方法上[或者标注在BaseService子类的execute方法上]
desc 接口描述
open 是否是开放api(不需要登录),默认false
permission 接口的权限标识
record 是否记录日志(一般指数据库简要日志),默认true
@JsonResult 标注在请求的方法上[或者标注在BaseService子类的execute方法上]
info 是否提示消息,默认false
message 消息提示内容,默认:操作成功

说明:所有标注JsonResult注解的请求方法,返回统一json结构,示例如下:   
    {
        "status":1200,info:true,message:"操作成功",data:obj      ---obj  表示具体返回值
    }
status为返回状态:1200成功,2500系统错误,1500业务错误,1403权限不足,1413参数校验错误  

3、json api快速开发 添加spring bean(在类上面标注@service/@component)并继承com.qsyout.sdk.declare.BaseService,bean命名必须以Service结尾;
2、接口注册:在resources/receives下根据url路径添加xml文件,例如:
url:/sys/menu/loadMenuData.do ---> LoadMenuDataService
接口定义位置
4、xml校验框架的使用
在resources/receives定义参数结构,例如:
resources/receives/sys/menu/loadMenuData.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//qsyout.com,receive map params validate tag library" "http://xmldtd.qsyout.com/validate.dtd" >
<map>
	<string name="name"></string>
</map>
根据dtd可以自动提示参数节点;  
继承BaseService的spring bean--->LoadMenuDataService在执行前,自行按照xml定义的节点内容进行校验,标注JsonResult注解的RequestMapping方法,在其方法的Map参数上标注XmlValid并配置xml路径,亦可进行参数校验。  

5、持久化操作
mybatis的xml文件直接定义在resources/sqlmap下,例如:
sqlmap定义位置

统一调用IbatisDao的相关方法即可完成数据库操作:  
    ibatisDao.update(String statementName, Object params)    数据操纵语言DML(新增/编辑/删除)     
    ibatisDao.load(String statementName, Object params)    数据查询语言DQL(查询结果仅仅一条,大于一条报错)     
    ibatisDao.queryForList(String statementName, Object params)    数据查询语言DQL(查询结果大于等于一条)     
    statementName:TABLE_NAME.insert    params:mybatis参数(parameterType)    

继承BaseService的spring bean中可直接使用属性ibatisDao,其他spring bean中需要注入IbatisDao后使用;     

必要时在相应方法上添加@Transactional即可进行事务管理;     

6、异常处理
不同的应用场景抛出不同的异常,便于程序对异常进行统一管理:
业务异常:com.qsyout.sdk.ex.BusinessException,在也业务方法中抛出,用于当***不满足业务条件时提醒用户消息;
参数校验异常:com.qsyout.sdk.ex.ParamsValidateException,很少调用,框架一般会进入业务方法前校验参数,当参数不符合条件时,抛出该异常,当一些特殊场景需要按照条件校验参数时用到;
com.qsyout.sdk.ex.ForbiddenException,很少调用,框架一般在验证权限时调用;

上述异常的响应状态码分别对应jsonresult的status码:1500、1413、1403  

7、工具类介绍 DateUtil 时间相关的工具类
EncryptUtil 加密工具类(md5)
JSEscapeUtils java模拟js的escape和unescape函数
MailUtil 发送邮件工具类
SpringUtil spring获取bean工具类
StringUtil 字符串工具类
SubjectUtil 当前请求工具类封装
WebUtil web相关的工具类

8、视图开发
所有的视图页面均存放于resources/views目录下;
框架使用beetl进行视图渲染,视图开发的语法遵从beetl相关规范;
系统首页指向/index.html页面,该页面默认无任何内容仅做跳转,当已登录后跳转至后台管理页面反之跳转登录页面,若业务逻辑不符合要求,可在对应路径下重写/index.html页面;

系统登录页面指向/login.html,若登录页面不符合业务需要,可重写/login.html页面风格并在该页面中添加如下代码即可:  
    <% include("/system/login-form.html",{}){} %>
上述代码中包含了用户名、密码、验证码、忘记密码等相关功能逻辑和校验,仅需将登录组件嵌入到自定义UI界面即可;   

后台管理系统的左侧菜单系统设置和工作台之间预留了自定义导航菜单的位置,按照element-ui的【NavMenu 导航菜单】语法重写/business-nav-menu.html页面即可完成自定义导航菜单的嵌入。
内置自定义beetl函数hasPermission('permission1','permission2'……)表示是否包含了permission1或者permission2权限标识中的一个,函数返回true或者false。

技术支持

技术交流群QQ:1009166083,有任何问题或者技术咨询可发送邮件到2375276632@qq.com

黑名单

服务声明

开发不易,做一名纯粹的技术工作者更是不易,尊重他人劳动成果既是尊重自己,期望得到大家的认可和支持。

任何组织和个人均可免费使用,凡是不尊重技术工作者的企业和个人将被列入黑名单并且失去免费使用的权利。

本版本仅按照最基础的权限模型进行设计,后续会进行补全;
其他权限模型的版本web-rbac0-dac,web-rbac1……以及更加复杂的权限模型基础框架持续更新中。

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 有如下情形之一的企业或者个人将被列入黑名单: 被公开强制加班的企业或个人; 被公开强迫员工离职的企业或个人; 被公开强制实行996的企业或个人; 公开诋毁辱骂作者或者项目的企业或个人; 任何被列入黑名单的企业或者个人失去免费使用权利的同时,并需要补缴使用本项目期间的年费:5000元每年

简介

基于rbac0权限设计的后台管理系统 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/LIU_SG_FLY/web-rbac0.git
git@gitee.com:LIU_SG_FLY/web-rbac0.git
LIU_SG_FLY
web-rbac0
web-rbac0
master

搜索帮助