From c82ef37ad795c3a68f7b4c751f527d03e6406a53 Mon Sep 17 00:00:00 2001 From: liuxm <liuxm@fescotech.com> Date: 星期三, 08 五月 2024 15:39:53 +0800 Subject: [PATCH] 权限验证 --- pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/util/PrivilegeListener.java | 6 ++++-- pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java | 10 +++++----- pms-parent/pms-global/src/main/resources/privileges-config.xml | 12 ++++++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pms-parent/pms-global/src/main/resources/privileges-config.xml b/pms-parent/pms-global/src/main/resources/privileges-config.xml index 46fca3b..2b40a70 100644 --- a/pms-parent/pms-global/src/main/resources/privileges-config.xml +++ b/pms-parent/pms-global/src/main/resources/privileges-config.xml @@ -7,12 +7,16 @@ --> <privileges> <!-- 鍩虹鏉� --> - <privilege num="10100010" name="鐢ㄦ按鎴锋煡璇�" type="1010"></privilege> - <privilege num="10100011" name="鐢ㄦ按鎴风鐞�" type="1010"></privilege> + <privilege num="10100010" name="绯荤粺鏌ヨ" type="1010" typeName="鍩虹鏉�"></privilege> + <privilege num="10100011" name="绯荤粺绠$悊" type="1010" typeName="鍩虹鏉�"></privilege> <!-- 鐢熶骇绠$悊 --> - <privilege num="10200000" name="浜у搧鏌ヨ" type="1020"></privilege> - <privilege num="10200001" name="浜у搧绠$悊" type="1020"></privilege> + <privilege num="10200000" name="浜у搧鏌ヨ" type="1020" typeName="鐢熶骇绠$悊"></privilege> + <privilege num="10200001" name="浜у搧绠$悊" type="1020" typeName="鐢熶骇绠$悊"></privilege> + + <!-- 骞冲彴淇℃伅 --> + <privilege num="10300000" name="骞冲彴鏌ヨ" type="1030" typeName="骞冲彴淇℃伅"></privilege> + <privilege num="10300001" name="骞冲彴绠$悊" type="1030" typeName="骞冲彴淇℃伅"></privilege> </privileges> diff --git a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/util/PrivilegeListener.java b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/util/PrivilegeListener.java index d8d7aa5..9fdd527 100644 --- a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/util/PrivilegeListener.java +++ b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/util/PrivilegeListener.java @@ -80,7 +80,8 @@ String num = ele.getAttributeValue("num") ; String name = ele.getAttributeValue("name") ; String type = ele.getAttributeValue("type") ; - this.savePrivilege(num, name, type); + String typeName = ele.getAttributeValue("type_name") ; + this.savePrivilege(num, name, type,typeName); } } } @@ -104,7 +105,7 @@ * @param name 鍚嶇О * @param type 绫诲瀷 */ - private void savePrivilege(String num, String name, String type) throws Exception{ + private void savePrivilege(String num, String name, String type,String typeName) throws Exception{ if((num != null && !num.trim().equals("")) && (name != null && !name.trim().equals("")) && (type != null && !type.trim().equals(""))){ @@ -113,6 +114,7 @@ po.num = Integer.parseInt(num) ; po.name = name ; po.type = Integer.parseInt(type) ; + po.typeName = typeName ; this.privilegeDao.insertSelective(po) ; } } diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java index 0f93791..66ceacc 100644 --- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java +++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java @@ -46,7 +46,7 @@ * @return */ @PostMapping(path="save") - @SsoPowerAop(power = "10100011") + @SsoPowerAop(power = "10300001") @Log("淇濆瓨浜у搧淇℃伅") public BaseResponse<PltProduct> save(@RequestBody @Valid PltProduct pro, BindingResult bindingResult){ pro.id = null; @@ -76,7 +76,7 @@ * @return */ @PostMapping(path="update") - @SsoPowerAop(power = "10100011") + @SsoPowerAop(power = "10300001") @Log("鏇存柊浜у搧淇℃伅") public BaseResponse<PltProduct> update(@RequestBody @Valid PltProduct pro,BindingResult bindingResult){ int count; @@ -102,7 +102,7 @@ * @return */ @GetMapping(path="delete") - @SsoPowerAop(power = "10100011") + @SsoPowerAop(power = "10300001") @Log("鍒犻櫎浜у搧淇℃伅") public BaseResponse<PltProduct> delete(String id){ try { @@ -119,7 +119,7 @@ * @return */ @GetMapping(path="one") - @SsoPowerAop(power = "10100010") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇� + @SsoPowerAop(power = "10300000") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇� @Log("鏍规嵁ID鏌ヨ浜у搧淇℃伅") public BaseResponse<PltProduct> one(String id){ try{ @@ -138,7 +138,7 @@ * @return */ @PostMapping(path="some") - @SsoPowerAop(power = "10100010") + @SsoPowerAop(power = "10300000") @Log("鏌ヨ浜у搧淇℃伅") public BaseResponse<QueryResultVo<List<PltProduct>>> some(@RequestBody QueryVo vo){ try { -- Gitblit v1.8.0