This commit is contained in:
zf 2025-02-14 12:47:30 +08:00
commit 157524223b
1512 changed files with 143841 additions and 0 deletions

38
.gitignore vendored Normal file
View File

@ -0,0 +1,38 @@
*.class
# maven ignore
target/
*.jar
*.war
*.zip
*.tar
*.tar.gz
# eclipse ignore
.externalToolBuilders
.springBeans
# idea ignore
.idea/
*.ipr
*.iml
*.iws
# temp ignore
*.log
*.cache
*.diff
*.patch
*.tmp
# system ignore
.DS_Store
Thumbs.db
# custom lib
!custom_lib/*
/bin
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.factorypath

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2018 RuoYi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

31
README.md Normal file
View File

@ -0,0 +1,31 @@
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
7. 参数管理:对系统动态配置常用参数。
8. 通知公告:系统通知公告信息发布维护。
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
10. 登录日志:系统登录日志记录查询包含登录异常。
11. 在线用户:当前系统中活跃用户状态监控。
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
13. 代码生成前后端代码的生成java、html、xml、sql支持CRUD下载 。
14. 系统接口根据业务代码自动生成相关的api接口文档。
15. 服务监控监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 缓存监控:对系统的缓存信息查询,命令统计等。
17. 在线构建器拖动表单元素生成相应的HTML代码。
18. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
## 集成新增功能
1. 集成druid实现数据库密码加密功能
2. 集成mybatis-plus实现mybatis增强
3. 集成knife4j实现swagger文档增强 访问地址http://ip:port/doc.html
4. 集成easyexcel实现excel表格增强
6. 加入license
开发时停用此功能的方法LicenseCheckListener类注释掉@Component注解LicenseAspectConfig类注释掉@Configuration注解
7. 区分部署多个项目的Redis缓存

BIN
doc/license/certfile.cer Normal file

Binary file not shown.

167
doc/license/license.md Normal file
View File

@ -0,0 +1,167 @@
# license
### **license授权机制的原理**
1生成密钥对包含私钥和公钥。2授权者保留私钥使用私钥对授权信息诸如使用截止日期mac 地址等内容生成 license 签名证书。3公钥给使用者放在代码中使用用于验证 license 签名证书是否符合使用条件。
#### 使用KeyTool生成密匙库
1. 生成私钥库文件 使用jdk keytool工具 工具路径C:\Program Files\Java\jdk1.8.0_131\bin cmd使用管理员身份运行
```shell
keytool -genkeypair -keysize 1024 -validity 36500 -alias WMSKEY -keystore privateKeys.keystore -storepass 21#nS@NjJK20 -keypass WMS-21#nS@NjJK20 -dname "CN=ZF, OU=FBE, O=IT, L=NJ, ST=JS, C=CN"
```
> **参数说明:**
>
> 示例 keytool -genkeypair -keysize 1024 -validity 36500 -alias 私钥别称(WMSKEY) -keystore privateKeys.keystore -storepass 指定私钥库的密码(21#nS@NjJK20) -keypass 密钥密码(WMS-21#nS@NjJK20) -dname "CN=ZF, OU=FBE, O=IT, L=NJ, ST=JS, C=CN"
> - keysize 密钥长度
> - validity 私钥的有效期(单位:天)
> - alias 私钥别称 WMSKEY
> - keystore 指定私钥库文件的名称 (生成在当前目录)
> - storepass 指定私钥库的密码 (keystore 文件存储密码 21#nS@NjJK20
> - keypass 指定别名条目的密码 (私钥加解密密码) WMS-21#nS@NjJK20
> - dname 证书个人信息
> - CN 为你的姓名
> - OU 为你的组织单位名称
> - O 为你的组织名称
> - L 为你所在的城市名称
> - ST 为你所在的省份名称
> - C 为你的国家名称
2. 生成证书文件
```shell
keytool -exportcert -alias WMSKEY -keystore privateKeys.keystore -storepass 21#nS@NjJK20 -file certfile.cer
```
> **参数说明:**
> - 示例 keytool -exportcert -alias 私钥别称(WMSKEY) -keystore privateKeys.keystore -storepass 私钥库的密码(21#nS@NjJK20) -file certfile.cer
> - alias 私钥别称 WMSKEY
> - keystore 指定私钥库文件的名称 (如果没有带路径,在当前目录查找)
> - storepass 指定私钥库的密码 21#nS@NjJK20
> - file 导出证书文件名称
3. 生成公钥库
```shell
keytool -import -alias PUBLICKEY -file certfile.cer -keystore publicCerts.keystore -storepass 21#nS@NjJK20
```
> **参数说明:**
> - keytool -import -alias 公钥别称配置文件配置(PUBLICKEY) -file certfile.cer -keystore publicCerts.keystore -storepass 访问公钥库的密码(21#nS@NjJK20)
> - alias 公钥别称 PUBLICKEY
> - file 证书文件名称
> - keystore 公钥文件名称
> - storepass 指定私钥库的密码 21#nS@NjJK20
看到以下三个文件:
- privateKeys.keystore私钥提供给生成证书使用
- publicCerts.keystore公钥提供给证书认证使用
- certfile.cer后续步骤用不到可以删除。
#### License证书
根据客户服务器硬件信息MAC地址、IP地址、CPU序列号、主板序列号生成授权证书同时可以给授权证书设置生效时间与失效时间。
整个授权过程分为三步:
1. 获取客户端服务器信息license-server-info服务
> 将license-server-info服务部署到客户服务器上
>
> 请求接口`/license/getServerInfo`
>
> 得到硬件信息:
>
> ```json
> {
> "ipAddress": [ //授权的ip列表
> "172.17.0.8"
> ],
> "macAddress": [ //授权的mac地址列表
> "52-54-00-74-0B-D9"
> ],
> "cpuSerial": "55 06 05 00 FF FB 8B 0F", //cpu序列号
> "mainBoardSerial": "afb14aac-eccb-4a37-9c31-e7951ce73e0d"//主板序列号
> }
> ```
2. 生成授权证书license-creator服务
> 我们自己部署生成证书的服务license-creator
>
> 请求接口`/license/generateLicense`
>
> 入参传入授权信息:
>
> ```json
> {
>
> "expiryTime":"2023-01-05 00:00:00", //失效时间
> "issuedTime":"2021-01-01 00:00:00", //生效时间
> "keyPass":"WMS", //密钥的密码
> "privateAlias":"WMSKEY",
> "licensePath":"/Users/zf/Documents/license/license.lic", //证书生成地址
> "privateKeysStorePath":"/Users/zf/Documents/license/privateKeys.keystore",// 密钥文件地址
> "storePass":"21#nS@NjJK20", //访问公钥库的密码
> "subject":"wms-license",
> "licenseCheckModel":{ //授权验证信息
> "cpuSerial":"47A8E193-23D4-5B93-92AB-4A96FBC0346F",//cpu序列号
> "ipAddress":[ //ip
> "192.168.174.107"
> ],
> "macAddress":[ //mac地址
> "F8-FF-C2-6A-3E-73"
> ],
> "mainBoardSerial":"C02C31HZMD6P"//主板序列号
> }
> }
> ```
>
> 会生成一个`license.lic`授权文件到执行目录
3. 授权验证license-verify-starter
> 需要添加授权功能的服务需要依赖`license-verify-starter`
>
> 配置证书信息
>
> ```properties
> license.subject: wms-license
> license.publicAlias: PUBLICKEY
> license.storePass: 9527WMS
> license.licensePath: /Users/zf/Documents/license/license.lic
> license.publicKeysStorePath: /Users/zf/Documents/license/publicCerts.keystore
> ```
>
> 项目启动的时候,会去验证授权证书的有效性,是否在有效期内,硬件信息是否匹配,如果授权证书无效,项目启动失败。
>
> 另外可以在一些核心接口,比如登陆接口,添加`@License`注解,请求该接口的时候,也会去验证授权证书的有效性,比如验证证书是否到期,如果失效,该接口将会拒绝访问。
> 加入license
> 开发时停用此功能的方法LicenseCheckListener类注释掉@Component注解LicenseAspectConfig类注释掉@Configuration注解
> @PostMapping("/login") SysLoginController 接口加上@License 注解
# license 证书生成程序
使用说明
* 执行jar包 java -jar generate-license.jar 证书subject 密钥别称 密钥密码 访问公钥库的密码 证书生成路径与文件名 私钥库访问地址 证书失效时间证书生效时间 用户类型 用户数量 描述信息
* java -jar generate-license.jar wms-license WMSKEY WMS-21#nS@NjJK20 21#nS@NjJK20 D://wms//license//license.lic D://wms//license//privateKeys.keystore 2023-12-31 user 1 wms系统license

Binary file not shown.

Binary file not shown.

View File