From a34edef603d62624b790bb91407a92e3a0d175b4 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 29 Apr 2020 15:02:17 +0800 Subject: [PATCH 1/6] =?UTF-8?q?vuex=E7=94=A8=E6=88=B7=E5=90=8D=E5=8F=96?= =?UTF-8?q?=E5=80=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/store/modules/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js index 20f44bf46..dd2b6dbef 100644 --- a/ruoyi-ui/src/store/modules/user.js +++ b/ruoyi-ui/src/store/modules/user.js @@ -58,7 +58,7 @@ const user = { } else { commit('SET_ROLES', ['ROLE_DEFAULT']) } - commit('SET_NAME', user.username) + commit('SET_NAME', user.userName) commit('SET_AVATAR', avatar) resolve(res) }).catch(error => { From eec5c58b4a8d118270bfedb87cf38ebcab6fcc39 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 29 Apr 2020 16:06:49 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AD=97=E5=85=B8=E5=AD=97=E6=AE=B5int?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=B2=A1=E6=9C=89=E8=87=AA=E5=8A=A8=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi/src/main/resources/vm/vue/index-tree.vue.vm | 6 ++++-- ruoyi/src/main/resources/vm/vue/index.vue.vm | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ruoyi/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi/src/main/resources/vm/vue/index-tree.vue.vm index 6c33b9f6a..1a74fca67 100644 --- a/ruoyi/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi/src/main/resources/vm/vue/index-tree.vue.vm @@ -146,7 +146,8 @@ v-for="dict in ${field}Options" :key="dict.dictValue" :label="dict.dictLabel" - :value="dict.dictValue" + #if($column.javaType == "Integer"):value="parseInt(dict.dictValue)"#else:value="dict.dictValue"#end + > @@ -162,7 +163,8 @@ {{dict.dictLabel}} diff --git a/ruoyi/src/main/resources/vm/vue/index.vue.vm b/ruoyi/src/main/resources/vm/vue/index.vue.vm index 12022ca58..7c19a3aab 100644 --- a/ruoyi/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi/src/main/resources/vm/vue/index.vue.vm @@ -174,7 +174,8 @@ v-for="dict in ${field}Options" :key="dict.dictValue" :label="dict.dictLabel" - :value="dict.dictValue" + #if($column.javaType == "Integer"):value="parseInt(dict.dictValue)"#else:value="dict.dictValue"#end + > @@ -190,7 +191,8 @@ {{dict.dictLabel}} From 1a079532e823e78ce35f8fe7f312e37e8cd0f902 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 29 Apr 2020 21:14:12 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=8F=AA=E5=AF=B9json=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=9E=84=E5=BB=BA=E5=8F=AF=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E8=AF=BB=E5=8F=96inputStream=E7=9A=84request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/filter/RepeatableFilter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ruoyi/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java b/ruoyi/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java index a1125e346..6e3edfcee 100644 --- a/ruoyi/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java +++ b/ruoyi/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java @@ -8,6 +8,8 @@ import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; +import org.springframework.http.MediaType; +import com.ruoyi.common.utils.StringUtils; /** * Repeatable 过滤器 @@ -27,7 +29,8 @@ public class RepeatableFilter implements Filter throws IOException, ServletException { ServletRequest requestWrapper = null; - if (request instanceof HttpServletRequest) + if (request instanceof HttpServletRequest && StringUtils.equalsAnyIgnoreCase(request.getContentType(), + MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_JSON_UTF8_VALUE)) { requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); } From 2d93e7aeb3da856097db407952561354bc3899c8 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 29 Apr 2020 21:58:24 +0800 Subject: [PATCH 4/6] =?UTF-8?q?swagger=E6=B7=BB=E5=8A=A0enable=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=8E=A7=E5=88=B6=E6=98=AF=E5=90=A6=E5=90=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi/sql/ry_20200415.sql | 2 +- .../java/com/ruoyi/framework/config/SwaggerConfig.java | 7 +++++++ ruoyi/src/main/resources/application.yml | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ruoyi/sql/ry_20200415.sql b/ruoyi/sql/ry_20200415.sql index 8663aad8a..cf5124726 100644 --- a/ruoyi/sql/ry_20200415.sql +++ b/ruoyi/sql/ry_20200415.sql @@ -138,7 +138,7 @@ create table sys_menu ( is_frame int(1) default 1 comment '是否为外链(0是 1否)', menu_type char(1) default '' comment '菜单类型(M目录 C菜单 F按钮)', visible char(1) default 0 comment '菜单状态(0显示 1隐藏)', - status char(1) not null comment '菜单状态(0正常 1停用)', + status char(1) default 0 comment '菜单状态(0正常 1停用)', perms varchar(100) default null comment '权限标识', icon varchar(100) default '#' comment '菜单图标', create_by varchar(64) default '' comment '创建者', diff --git a/ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java b/ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java index a51cd34f6..74786d9ed 100644 --- a/ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java +++ b/ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java @@ -3,6 +3,7 @@ package com.ruoyi.framework.config; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import io.swagger.annotations.ApiOperation; @@ -32,6 +33,10 @@ public class SwaggerConfig @Autowired private RuoYiConfig ruoyiConfig; + /** Swagger开关配置 */ + @Value("${swagger.enable}") + private boolean swaggerEnable; + /** * 创建API */ @@ -39,6 +44,8 @@ public class SwaggerConfig public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) + // 是否启用Swagger + .enable(swaggerEnable) .pathMapping("/dev-api") // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) .apiInfo(apiInfo()) diff --git a/ruoyi/src/main/resources/application.yml b/ruoyi/src/main/resources/application.yml index 8658f879e..34b1f4324 100644 --- a/ruoyi/src/main/resources/application.yml +++ b/ruoyi/src/main/resources/application.yml @@ -100,6 +100,10 @@ pagehelper: supportMethodsArguments: true params: count=countSql +# Swagger配置 +swagger: + enable: true + # 防止XSS攻击 xss: # 过滤开关 From a3e97ed677447433a228f7727f5062f0baa929c7 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 29 Apr 2020 22:26:05 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml b/ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml index f5281b92d..a5e7be0b7 100644 --- a/ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml +++ b/ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml @@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ${dataScope} + order by r.role_sort