From f6aff482a287418aa102dd6967098f3ca81363d2 Mon Sep 17 00:00:00 2001 From: Lucky <641787296@qq.com> Date: Fri, 7 Feb 2020 03:10:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?:whale:=20Work=20about=20Docker.=C2=A0?= =?UTF-8?q?=C2=A0=20=E5=AE=8C=E5=96=84=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 15da3982a..ddd165323 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,8 @@ services: pigx-redis: image: redis:5.0.7 restart: always + # 加密 + #command: redis-server --requirepass lengleng@123 container_name: pigx-redis ports: - 6379:6379 From 4d805b172ad07eda52b54fc509fea9d27093e11a Mon Sep 17 00:00:00 2001 From: Lucky <641787296@qq.com> Date: Mon, 18 May 2020 10:53:34 +0800 Subject: [PATCH 2/4] =?UTF-8?q?:lock:=20=E4=BF=AE=E5=A4=8D=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E9=97=AE=E9=A2=98.=20=E5=AE=89=E5=85=A8=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E3=80=90=E8=B6=8A=E6=9D=83=E8=AE=BF=E9=97=AE=E3=80=91?= =?UTF-8?q?=E3=80=82=E4=BD=BF=E7=94=A8=E9=9D=9Eadmin=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E4=B8=94=E6=B2=A1=E6=9C=89=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90=E8=B4=A6=E5=8F=B7(test)=EF=BC=8C?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=B0=83=E9=80=9A=E8=8E=B7=E5=8F=96=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/template/Controller.java.vm | 2 ++ .../pigx-codegen/src/main/resources/template/menu.sql.vm | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm b/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm index 9eb5102e8..b159be4b0 100755 --- a/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm +++ b/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm @@ -52,6 +52,7 @@ public class ${className}Controller { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page" ) + @PreAuthorize("@pms.hasPermission('${moduleName}_${pathName}_page')" ) public R get${className}Page(Page page, ${className} ${classname}) { return R.ok(${classname}Service.page(page, Wrappers.query(${classname}))); } @@ -64,6 +65,7 @@ public class ${className}Controller { */ @ApiOperation(value = "通过id查询", notes = "通过id查询") @GetMapping("/{${pk.lowerAttrName}}" ) + @PreAuthorize("@pms.hasPermission('${moduleName}_${pathName}_get')" ) public R getById(@PathVariable("${pk.lowerAttrName}" ) ${pk.attrType} ${pk.lowerAttrName}) { return R.ok(${classname}Service.getById(${pk.lowerAttrName})); } diff --git a/pigx-visual/pigx-codegen/src/main/resources/template/menu.sql.vm b/pigx-visual/pigx-codegen/src/main/resources/template/menu.sql.vm index be3462305..2cf06a7b0 100644 --- a/pigx-visual/pigx-codegen/src/main/resources/template/menu.sql.vm +++ b/pigx-visual/pigx-codegen/src/main/resources/template/menu.sql.vm @@ -14,3 +14,7 @@ insert into `sys_menu` ( `parent_id`, `permission`, `type`, `path`, `icon`, `de SELECT @parentId, '${moduleName}_${pathName}_edit', '1', null, '1', '0', '2018-05-15 21:35:18', '1', '2018-07-29 13:38:59', '${comments}修改', 1; insert into `sys_menu` ( `parent_id`, `permission`, `type`, `path`, `icon`, `del_flag`, `create_time`, `sort`, `update_time`, `name`, `tenant_id`) SELECT @parentId, '${moduleName}_${pathName}_del', '1', null, '1', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}删除', 1; +insert into `sys_menu` ( `parent_id`, `permission`, `type`, `path`, `icon`, `del_flag`, `create_time`, `sort`, `update_time`, `name`, `tenant_id`) + SELECT @parentId, '${moduleName}_${pathName}_get', '1', null, '1', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}获取', 1; +insert into `sys_menu` ( `parent_id`, `permission`, `type`, `path`, `icon`, `del_flag`, `create_time`, `sort`, `update_time`, `name`, `tenant_id`) + SELECT @parentId, '${moduleName}_${pathName}_page', '1', null, '1', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}列表', 1; From e74e713256ef706617cc0393bd1528e8c0a8523e Mon Sep 17 00:00:00 2001 From: Lucky <641787296@qq.com> Date: Mon, 18 May 2020 10:57:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E3=80=82=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=8F=8F=E8=BF=B0=EF=BC=8C=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E7=A6=81=E7=94=A8Swagger2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pigx/common/swagger/config/SwaggerAutoConfiguration.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java b/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java index a07a1c2c3..3d46d4af7 100644 --- a/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java +++ b/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java @@ -43,6 +43,8 @@ import java.util.List; /** * @author lengleng * swagger配置 + * 禁用方法1:使用注解@Profile({"dev","test"}) 表示在开发或测试环境开启,而在生产关闭。(推荐使用) + * 禁用方法2:使用注解@ConditionalOnProperty(name = "swagger.enable", havingValue = "true") 然后在测试配置或者开发配置中添加swagger.enable=true即可开启,生产环境不填则默认关闭Swagger. */ @Configuration @EnableSwagger2 From 8cbef7f43d27c205efb8d75cd84c61beb1243393 Mon Sep 17 00:00:00 2001 From: Lucky <641787296@qq.com> Date: Mon, 18 May 2020 11:05:52 +0800 Subject: [PATCH 4/4] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E3=80=82=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9D=83=E9=99=90get?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pigx-codegen/src/main/resources/template/Controller.java.vm | 2 +- .../pigx-codegen/src/main/resources/template/menu.sql.vm | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm b/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm index b159be4b0..ed49e2952 100755 --- a/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm +++ b/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm @@ -52,7 +52,7 @@ public class ${className}Controller { */ @ApiOperation(value = "分页查询", notes = "分页查询") @GetMapping("/page" ) - @PreAuthorize("@pms.hasPermission('${moduleName}_${pathName}_page')" ) + @PreAuthorize("@pms.hasPermission('${moduleName}_${pathName}_get')" ) public R get${className}Page(Page page, ${className} ${classname}) { return R.ok(${classname}Service.page(page, Wrappers.query(${classname}))); } diff --git a/pigx-visual/pigx-codegen/src/main/resources/template/menu.sql.vm b/pigx-visual/pigx-codegen/src/main/resources/template/menu.sql.vm index 2cf06a7b0..0232d8c4c 100644 --- a/pigx-visual/pigx-codegen/src/main/resources/template/menu.sql.vm +++ b/pigx-visual/pigx-codegen/src/main/resources/template/menu.sql.vm @@ -16,5 +16,3 @@ insert into `sys_menu` ( `parent_id`, `permission`, `type`, `path`, `icon`, `del SELECT @parentId, '${moduleName}_${pathName}_del', '1', null, '1', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}删除', 1; insert into `sys_menu` ( `parent_id`, `permission`, `type`, `path`, `icon`, `del_flag`, `create_time`, `sort`, `update_time`, `name`, `tenant_id`) SELECT @parentId, '${moduleName}_${pathName}_get', '1', null, '1', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}获取', 1; -insert into `sys_menu` ( `parent_id`, `permission`, `type`, `path`, `icon`, `del_flag`, `create_time`, `sort`, `update_time`, `name`, `tenant_id`) - SELECT @parentId, '${moduleName}_${pathName}_page', '1', null, '1', '0', '2018-05-15 21:35:18', '2', '2018-07-29 13:38:59', '${comments}列表', 1;