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] =?UTF-8?q?:lock:=20=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98.=20=E5=AE=89=E5=85=A8=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E3=80=90=E8=B6=8A=E6=9D=83=E8=AE=BF=E9=97=AE=E3=80=91=E3=80=82?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=9D=9Eadmin=E8=B4=A6=E5=8F=B7=E4=B8=94?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95=E7=9A=84?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B4=A6=E5=8F=B7(test)=EF=BC=8C=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E8=B0=83=E9=80=9A=E8=8E=B7=E5=8F=96=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=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;