Merge remote-tracking branch 'LionLi/dev' into dev

This commit is contained in:
phanes 2021-11-12 21:39:43 +08:00
commit e45988223c
13 changed files with 81 additions and 112 deletions

View File

@ -10,7 +10,9 @@
[![JDK-11](https://img.shields.io/badge/JDK-11-green.svg)]() [![JDK-11](https://img.shields.io/badge/JDK-11-green.svg)]()
[![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]() [![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]()
RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级(不兼容原框架) > RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级(不兼容原框架)
> 系统演示: [传送门](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/系统演示?sort_id=4836388)
| 功能介绍 | 使用技术 | 文档地址 | 特性注意事项 | | 功能介绍 | 使用技术 | 文档地址 | 特性注意事项 |
|---|---|---|---| |---|---|---|---|
@ -61,8 +63,7 @@ RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级(不兼
## 软件架构图 ## 软件架构图
![Plus部署架构图](https://images.gitee.com/uploads/images/2021/0729/112230_4295e5ce_1766278.png "Plus部署架构图.png") ![Plus部署架构图](https://images.gitee.com/uploads/images/2021/1112/202137_673ac5d2_1766278.png "Plus部署架构图.png")
## 贡献代码 ## 贡献代码
欢迎各路英雄豪杰 `PR` 代码 请提交到 `dev` 开发分支 统一测试发版 欢迎各路英雄豪杰 `PR` 代码 请提交到 `dev` 开发分支 统一测试发版

13
pom.xml
View File

@ -28,13 +28,13 @@
<jwt.version>0.9.1</jwt.version> <jwt.version>0.9.1</jwt.version>
<mybatis-plus.version>3.4.3.4</mybatis-plus.version> <mybatis-plus.version>3.4.3.4</mybatis-plus.version>
<p6spy.version>3.9.1</p6spy.version> <p6spy.version>3.9.1</p6spy.version>
<hutool.version>5.7.15</hutool.version> <hutool.version>5.7.16</hutool.version>
<okhttp.version>4.9.1</okhttp.version> <okhttp.version>4.9.2</okhttp.version>
<spring-boot-admin.version>2.5.2</spring-boot-admin.version> <spring-boot-admin.version>2.5.3</spring-boot-admin.version>
<redisson.version>3.16.3</redisson.version> <redisson.version>3.16.4</redisson.version>
<lock4j.version>2.2.1</lock4j.version> <lock4j.version>2.2.1</lock4j.version>
<dynamic-ds.version>3.4.1</dynamic-ds.version> <dynamic-ds.version>3.4.1</dynamic-ds.version>
<tlog.version>1.3.3</tlog.version> <tlog.version>1.3.4</tlog.version>
<xxl-job.version>2.3.0</xxl-job.version> <xxl-job.version>2.3.0</xxl-job.version>
<!-- jdk11 缺失依赖 jaxb--> <!-- jdk11 缺失依赖 jaxb-->
@ -350,6 +350,7 @@
<!-- 环境标识,需要与配置文件的名称相对应 --> <!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>local</profiles.active> <profiles.active>local</profiles.active>
<logging.level>debug</logging.level> <logging.level>debug</logging.level>
<knife4j.production>false</knife4j.production>
<endpoints.include>'*'</endpoints.include> <endpoints.include>'*'</endpoints.include>
</properties> </properties>
</profile> </profile>
@ -359,6 +360,7 @@
<!-- 环境标识,需要与配置文件的名称相对应 --> <!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>dev</profiles.active> <profiles.active>dev</profiles.active>
<logging.level>debug</logging.level> <logging.level>debug</logging.level>
<knife4j.production>false</knife4j.production>
<endpoints.include>'*'</endpoints.include> <endpoints.include>'*'</endpoints.include>
</properties> </properties>
<activation> <activation>
@ -371,6 +373,7 @@
<properties> <properties>
<profiles.active>prod</profiles.active> <profiles.active>prod</profiles.active>
<logging.level>warn</logging.level> <logging.level>warn</logging.level>
<knife4j.production>true</knife4j.production>
<endpoints.include>health, info, logfile</endpoints.include> <endpoints.include>health, info, logfile</endpoints.include>
</properties> </properties>
</profile> </profile>

View File

@ -3,7 +3,7 @@ spring:
servlet: servlet:
multipart: multipart:
# 临时文件存储位置 避免临时文件被系统清理报错 # 临时文件存储位置 避免临时文件被系统清理报错
location: ./temp location: /ruoyi/server/temp
--- # 监控配置 --- # 监控配置
spring: spring:

View File

@ -214,6 +214,22 @@ swagger:
- name: 3.代码生成模块 - name: 3.代码生成模块
basePackage: com.ruoyi.generator basePackage: com.ruoyi.generator
knife4j:
# 是否开启Knife4j增强模式
enable: true
# 是否开启生产环境保护策略
production: @knife4j.production@
# 前端Ui的个性化配置属性
setting:
# 默认语言
language: zh-CN
# 是否显示Footer
enableFooter: false
# 是否开启动态参数调试功能
enableDynamicParameter: true
# 是否在每个Debug调试栏后显示刷新变量按钮
enableReloadCacheParameter: true
# 防止XSS攻击 # 防止XSS攻击
xss: xss:
# 过滤开关 # 过滤开关

View File

@ -1,5 +1,6 @@
package com.ruoyi.common.utils; package com.ruoyi.common.utils;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpStatus; import cn.hutool.http.HttpStatus;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -63,7 +64,9 @@ public class PageUtils {
} }
PagePlus<T, K> page = new PagePlus<>(pageNum, pageSize); PagePlus<T, K> page = new PagePlus<>(pageNum, pageSize);
OrderItem orderItem = buildOrderItem(orderByColumn, isAsc); OrderItem orderItem = buildOrderItem(orderByColumn, isAsc);
if (ObjectUtil.isNotNull(orderItem)) {
page.addOrder(orderItem); page.addOrder(orderItem);
}
return page; return page;
} }
@ -87,7 +90,9 @@ public class PageUtils {
} }
Page<T> page = new Page<>(pageNum, pageSize); Page<T> page = new Page<>(pageNum, pageSize);
OrderItem orderItem = buildOrderItem(orderByColumn, isAsc); OrderItem orderItem = buildOrderItem(orderByColumn, isAsc);
if (ObjectUtil.isNotNull(orderItem)) {
page.addOrder(orderItem); page.addOrder(orderItem);
}
return page; return page;
} }

View File

@ -25,8 +25,7 @@ import org.springframework.web.filter.CorsFilter;
* @author ruoyi * @author ruoyi
*/ */
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter public class SecurityConfig extends WebSecurityConfigurerAdapter {
{
/** /**
* 自定义用户认证逻辑 * 自定义用户认证逻辑
*/ */
@ -68,8 +67,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/ */
@Bean @Bean
@Override @Override
public AuthenticationManager authenticationManagerBean() throws Exception public AuthenticationManager authenticationManagerBean() throws Exception {
{
return super.authenticationManagerBean(); return super.authenticationManagerBean();
} }
@ -89,8 +87,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
* authenticated | 用户登录后可访问 * authenticated | 用户登录后可访问
*/ */
@Override @Override
protected void configure(HttpSecurity httpSecurity) throws Exception protected void configure(HttpSecurity httpSecurity) throws Exception {
{
httpSecurity httpSecurity
// CSRF禁用因为不使用session // CSRF禁用因为不使用session
.csrf().disable() .csrf().disable()
@ -126,8 +123,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
* 强散列哈希加密实现 * 强散列哈希加密实现
*/ */
@Bean @Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() public BCryptPasswordEncoder bCryptPasswordEncoder() {
{
return new BCryptPasswordEncoder(); return new BCryptPasswordEncoder();
} }
@ -135,8 +131,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
* 身份认证接口 * 身份认证接口
*/ */
@Override @Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception protected void configure(AuthenticationManagerBuilder auth) throws Exception {
{
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
} }
} }

View File

@ -1,6 +1,7 @@
package com.ruoyi.framework.config; package com.ruoyi.framework.config;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver;
import com.ruoyi.common.properties.TokenProperties; import com.ruoyi.common.properties.TokenProperties;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.common.utils.spring.SpringUtils;
@ -35,6 +36,9 @@ public class SwaggerConfig {
@Autowired @Autowired
private TokenProperties tokenProperties; private TokenProperties tokenProperties;
@Autowired
private OpenApiExtensionResolver openApiExtensionResolver;
/** /**
* 创建API * 创建API
*/ */
@ -59,6 +63,7 @@ public class SwaggerConfig {
// 设置安全模式swagger可以设置访问token // 设置安全模式swagger可以设置访问token
.securitySchemes(securitySchemes()) .securitySchemes(securitySchemes())
.securityContexts(securityContexts()) .securityContexts(securityContexts())
.extensions(openApiExtensionResolver.buildExtensions(group.getName()))
.pathMapping(swaggerProperties.getPathMapping()); .pathMapping(swaggerProperties.getPathMapping());
String beanName = StringUtils.substringAfterLast(basePackage, ".") + "Docket"; String beanName = StringUtils.substringAfterLast(basePackage, ".") + "Docket";
SpringUtils.registerBean(beanName, docket); SpringUtils.registerBean(beanName, docket);

View File

@ -7,8 +7,8 @@ ENV = 'development'
# 若依管理系统/开发环境 # 若依管理系统/开发环境
VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = '/dev-api'
# 应用访问路径 例如使用前缀 /admin/index # 应用访问路径 例如使用前缀 /admin/
VUE_APP_CONTEXT_PATH = '/index' VUE_APP_CONTEXT_PATH = '/'
# 监控地址 # 监控地址
VUE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/login' VUE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/login'

View File

@ -4,8 +4,8 @@ VUE_APP_TITLE = RuoYi-Vue-Plus后台管理系统
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'
# 应用访问路径 例如使用前缀 /admin/index # 应用访问路径 例如使用前缀 /admin/
VUE_APP_CONTEXT_PATH = '/index' VUE_APP_CONTEXT_PATH = '/'
# 监控地址 # 监控地址
VUE_APP_MONITRO_ADMIN = '/admin/login' VUE_APP_MONITRO_ADMIN = '/admin/login'

View File

@ -6,8 +6,8 @@ NODE_ENV = production
# 测试环境配置 # 测试环境配置
ENV = 'staging' ENV = 'staging'
# 应用访问路径 例如使用前缀 /admin/index # 应用访问路径 例如使用前缀 /admin/
VUE_APP_CONTEXT_PATH = '/index' VUE_APP_CONTEXT_PATH = '/'
# 监控地址 # 监控地址
VUE_APP_MONITRO_ADMIN = '/admin/login' VUE_APP_MONITRO_ADMIN = '/admin/login'

View File

@ -102,7 +102,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('LogOut').then(() => {
location.href = process.env.VUE_APP_CONTEXT_PATH; location.href = process.env.VUE_APP_CONTEXT_PATH + "index";
}) })
}).catch(() => {}); }).catch(() => {});
} }

View File

@ -65,7 +65,7 @@ service.interceptors.response.use(res => {
} }
).then(() => { ).then(() => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
location.href = process.env.VUE_APP_CONTEXT_PATH; location.href = process.env.VUE_APP_CONTEXT_PATH + "index";
}) })
}).catch(() => {}); }).catch(() => {});
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject('无效的会话,或者会话已过期,请重新登录。')

View File

@ -248,13 +248,6 @@ insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', '', 1,
insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', sysdate(), '', null, ''); insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, ''); insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, ''); insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', sysdate(), '', null, '');
-- 定时任务按钮
# insert into sys_menu values('1049', '任务查询', '110', '1', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:query', '#', 'admin', sysdate(), '', null, '');
# insert into sys_menu values('1050', '任务新增', '110', '2', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:add', '#', 'admin', sysdate(), '', null, '');
# insert into sys_menu values('1051', '任务修改', '110', '3', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:edit', '#', 'admin', sysdate(), '', null, '');
# insert into sys_menu values('1052', '任务删除', '110', '4', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:remove', '#', 'admin', sysdate(), '', null, '');
# insert into sys_menu values('1053', '状态修改', '110', '5', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:changeStatus', '#', 'admin', sysdate(), '', null, '');
# insert into sys_menu values('1054', '任务导出', '110', '7', '#', '', '', 1, 0, 'F', '0', '0', 'monitor:job:export', '#', 'admin', sysdate(), '', null, '');
-- 代码生成按钮 -- 代码生成按钮
insert into sys_menu values('1055', '生成查询', '115', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, ''); insert into sys_menu values('1055', '生成查询', '115', '1', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, ''); insert into sys_menu values('1056', '生成修改', '115', '2', '#', '', '', 1, 0, 'F', '0', '0', 'tool:gen:edit', '#', 'admin', sysdate(), '', null, '');
@ -373,12 +366,6 @@ insert into sys_role_menu values ('2', '1045');
insert into sys_role_menu values ('2', '1046'); insert into sys_role_menu values ('2', '1046');
insert into sys_role_menu values ('2', '1047'); insert into sys_role_menu values ('2', '1047');
insert into sys_role_menu values ('2', '1048'); insert into sys_role_menu values ('2', '1048');
insert into sys_role_menu values ('2', '1049');
insert into sys_role_menu values ('2', '1050');
insert into sys_role_menu values ('2', '1051');
insert into sys_role_menu values ('2', '1052');
insert into sys_role_menu values ('2', '1053');
insert into sys_role_menu values ('2', '1054');
insert into sys_role_menu values ('2', '1055'); insert into sys_role_menu values ('2', '1055');
insert into sys_role_menu values ('2', '1056'); insert into sys_role_menu values ('2', '1056');
insert into sys_role_menu values ('2', '1057'); insert into sys_role_menu values ('2', '1057');
@ -575,49 +562,6 @@ create table sys_logininfor (
) engine=innodb auto_increment=100 comment = '系统访问记录'; ) engine=innodb auto_increment=100 comment = '系统访问记录';
-- ----------------------------
-- 15、定时任务调度表
-- ----------------------------
drop table if exists sys_job;
create table sys_job (
job_id bigint(20) not null auto_increment comment '任务ID',
job_name varchar(64) default '' comment '任务名称',
job_group varchar(64) default 'DEFAULT' comment '任务组名',
invoke_target varchar(500) not null comment '调用目标字符串',
cron_expression varchar(255) default '' comment 'cron执行表达式',
misfire_policy varchar(20) default '3' comment '计划执行错误策略1立即执行 2执行一次 3放弃执行',
concurrent char(1) default '1' comment '是否并发执行0允许 1禁止',
status char(1) default '0' comment '状态0正常 1暂停',
create_by varchar(64) default '' comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time datetime comment '更新时间',
remark varchar(500) default '' comment '备注信息',
primary key (job_id, job_name, job_group)
) engine=innodb auto_increment=100 comment = '定时任务调度表';
insert into sys_job values(1, '系统默认(无参)', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
insert into sys_job values(2, '系统默认(有参)', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
insert into sys_job values(3, '系统默认(多参)', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', sysdate(), '', null, '');
-- ----------------------------
-- 16、定时任务调度日志表
-- ----------------------------
drop table if exists sys_job_log;
create table sys_job_log (
job_log_id bigint(20) not null auto_increment comment '任务日志ID',
job_name varchar(64) not null comment '任务名称',
job_group varchar(64) not null comment '任务组名',
invoke_target varchar(500) not null comment '调用目标字符串',
job_message varchar(500) comment '日志信息',
status char(1) default '0' comment '执行状态0正常 1失败',
exception_info varchar(2000) default '' comment '异常信息',
create_time datetime comment '创建时间',
primary key (job_log_id)
) engine=innodb comment = '定时任务调度日志表';
-- ---------------------------- -- ----------------------------
-- 17、通知公告表 -- 17、通知公告表
-- ---------------------------- -- ----------------------------
@ -639,8 +583,8 @@ create table sys_notice (
-- ---------------------------- -- ----------------------------
-- 初始化-公告信息表数据 -- 初始化-公告信息表数据
-- ---------------------------- -- ----------------------------
insert into sys_notice values('1', '温馨提醒2018-07-01 若依新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员'); insert into sys_notice values('1', '温馨提醒2018-07-01 新版本发布啦', '2', '新版本内容', '0', 'admin', sysdate(), '', null, '管理员');
insert into sys_notice values('2', '维护通知2018-07-01 若依系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate(), '', null, '管理员'); insert into sys_notice values('2', '维护通知2018-07-01 系统凌晨维护', '1', '维护内容', '0', 'admin', sysdate(), '', null, '管理员');
-- ---------------------------- -- ----------------------------