1 Star 0 Fork 6

苏溢/基于SSM+Shiro+Redis+Layui的内容管理系统

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

基于SSM+Shiro+Redis+Layui的内容管理系统

1. 前言

本项目基于Gitee的开源项目Quella,进行了部分功能的二次开发。

原项目地址:https://gitee.com/quella01/Quella

原项目协议:Apache-2.0

原项目的最近一次更新发布于2019年1月,所以某些依赖有点过时。

但是此脚手架集成了一些通用的后台功能,如菜单设置、权限控制等,以及集成了常用的第三方服务,如七牛云存储第三方支付等,其开发模式还是值得学习和借鉴的。

并且,使用此脚手架能够快速进行后台管理系统的开发,非常适合敏捷开发。

下文,是基于此框架进行的二次开发,记录了详细的开发过程。

下文部分内容来自原仓库的说明文档和官方开发文档。

2. 项目演示

以下功能是原始系统的功能。

1、后台登录页面:

图:登录页

初始密码:admin

2、后台主页:

图:后台主页

点击右上角的用户名ssrs,点击设置,可以切换成选择卡视图,就是下面这种,每个页面带 x 的样式。

3、菜单设置:

图:菜单设置页

4、权限设置:

图:权限设置页

5、管理员设置:

图:管理员设置页

6、角色设置:

图:角色设置页

以下功能是在原始框架中,进行的二次开发。

7、教室信息管理

图:教室信息页面

8、设备信息管理:

图:设备信息页面

9、新增设备:

图:新增设备页

10、模糊查询:

图:模糊查询页

11、图表统计:

图:统计页

3. 快速部署

3.1 架构说明

  • 前端框架:基于Layui的kit-admin
  • 页面模板:采用 FreeMaker 与 JSP 双视图
  • 后端主要框架:Spring + SpringMVC + MybatisPlus + Shiro + Redis
  • Redis:分布式 session 与 分布式缓存
  • Quartz:任务调度方案
  • ElasticSearch:全文检索与数据分析方案

3.2 环境说明

  • JDK 1.8
  • Tomcat 7.0及以上
  • MySQL 5.7
  • Redis 3.0及以上
  • ElasticSearch 6.4.2(非必须)
  • 开发工具IDEA(需要安装Lombok插件)

以上环境,除了JDK、Tomcat、MySQL是必须的,Redis也是必须的,否则无法登录系统。

ElasticSearch 不是必须的。

如果是Windows系统,建议使用一键安装的Redis

地址:https://github.com/MicrosoftArchive/redis/releases

下载3.2或3.0版本的msi文件,一键安装即可使用。

推荐使用的Redis数据库可视化工具https://gitee.com/qishibo/AnotherRedisDesktopManager/releases

3.3 项目搭建详细过程

1、克隆项目至本地;

图:项目的主要文件

2、使用IDEA导入项目

图:导入项目1

3、选择Maven项目类型;

图:导入项目2

4、勾选Maven自动导入

图:导入项目3

5、勾选需要导入的Maven项目;

图:导入项目4

6、选择JDK版本

图:导入项目5

7、设置项目名

图:导入项目6

8、导入的项目完整结构

图:导入成功后的项目结构

9、右击resources文件夹,将其设置为资源根目录(右击→Make Dictionary as→Resources Root);

10、右击Test文件夹,将其设置为测试资源根目录(右击→Make Dictionary as→Test Sources Root);

图:设置成功后的资源文件夹

11、配置Tomcat

图:配置Tomcat-1

图:配置Tomcat-2

图:配置Tomcat-3

图:配置Tomcat-4

图:配置Tomcat-5

12、导入SQL脚本文件至自己的数据库;

图:数据库表

13、配置数据库信息

图:配置数据库信息

14、配置Redis信息(一般不需要修改);

图:配置Redis

15、启动Redis服务(一般安装完成后,自动启动);

16、运行项目;

17、浏览器自动跳转至登录页面

4. 快速上手

如何快速开发你需要管理的表呢?

下文的内容将解答你的疑惑。

4.1 一些建议

新建表

系统默认表的前缀是ssrs,为了区别于系统表,新建表的名字建议使用其他前缀,如示例中的前缀table;

后台开发

系统默认的后台项目文件,均在com.ssrs包下,如controller、model等。

为了区别于系统文件,在com.ssrs目录新建了一个名为dev的包,新编写的model、service、controller等文件,建议写在这里,如下图:

图:自己后台目录

前端开发

webapp 文件夹下,有一些静态资源,如css、js等,这是公共的。

webapp/WEB-INF/ftl 目录下,有一些系统默认的页面。

为了区别于系统默认的页面,在该目录下新建了一个名为devPages的文件夹,新编写的页面,建议写在这个文件夹下,如下图:

图:自己前端目录

4.2 添加菜单

启动项目后,即可进入项目后台

在项目后台页面,访问 系统设置>>菜单设置,点击 新增,即可为系统左侧菜单栏新增一个菜单,如下图:

图:添加菜单

这里注意,新增的菜单有两种类型:顶级菜单二级菜单

如果新增的是一个顶级菜单,在没有为其添加二级菜单的情况下,是不会在左侧显示的

顶级菜单的填写示例:

图:顶级菜单填写示例

二级菜单的填写示例:

图:二级菜单填写示例

链接标题、排序、权限名称,是可以任意填写的。

最重要的是链接地址,其地址,必须对应controller中的RequestMapping,否则无法实现响应和页面加载,如下图:

图:控制层示例

4.3 设置权限

本系统中的每个请求(即每个链接),都可以为其设置权限

一般来说,每个表单的增删改查,需要设置权限,并根据实际需求,为每个角色分配不同的权限。

在项目后台页面,访问 系统设置>>权限设置,点击 新增,即可为系统中的链接增加权限

图:新增权限

这里需要注意,权限Action的填写方式,和上文添加二级菜单的Action,一致。

然后,就可以将这些权限分配给每个角色,如下图:

图:分配权限

点击上图所获权限输入框(非 ×),即可展开权限树,勾选提交即可。

4.4 使用逆向工程生成代码

当我们的数据库中增加新的表单后,针对该表单的model、service、mapper、controller等文件,均不需要手动创建,可以直接使用项目提供的代码生成示例,一键生成。

首先使用和修改的信息,如下图所示:

图:逆向工程生成代码

然后右击运行,即可生成各个文件。

图:运行

上图示例代码生成的6个文件,如下图所示:

图:逆向工程生成的代码

最后,也是最重要的,把xml文件中的开启二级缓存部分注释掉!,如下图:

图:注释二级缓存

4.5 添加前端页面

devPages目录下,可以新增自己的一些页面,如添加页面、更新页面等,需要注意,添加的页面后缀应为ftl格式。

图:自己编写的页面示例

至此,关于此框架的一些常规的使用方法和注意事项,基本介绍完毕。

5. 下载

如果想更进一步了解此框架,可下载本项目,对源码进行详细的分析和学习。

LICENSE

Apache-2.0

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.

简介

Quella,是基于SSM+Shiro+Redis+Layui的内容管理系统。本项目在Quella的基础上,进行了示例开发,主要是方便更好地理解和使用此框架。 【另有基于Spring Boot的同款管理系统:https://gitee.com/geekrdc/ExciteCMS-SpringBoot-Layui ,欢迎体验】 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/su-su_susu/CMS-Quella-SSM.git
git@gitee.com:su-su_susu/CMS-Quella-SSM.git
su-su_susu
CMS-Quella-SSM
基于SSM+Shiro+Redis+Layui的内容管理系统
master

搜索帮助

A270a887 8829481 3d7a4017 8829481