From c93c60ca31300967db301c36624309fbae2cd125 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Wed, 30 Nov 2022 11:12:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F=E6=8E=88?= =?UTF-8?q?=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/version1/empower/system_license.go | 7 ++++--- overall/publicmethod/technique.go | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/api/version1/empower/system_license.go b/api/version1/empower/system_license.go index c7f51a0..8bbdcbf 100644 --- a/api/version1/empower/system_license.go +++ b/api/version1/empower/system_license.go @@ -2,6 +2,7 @@ package empower import ( "key_performance_indicators/overall/publicmethod" + "strings" "github.com/gin-gonic/gin" ) @@ -42,8 +43,8 @@ func (a *ApiMethod) ObtainAuthorization(c *gin.Context) { // return // } sendData := publicmethod.MapOut[string]() - sendData["powerid"] = pointId - sendData["poweroperationid"] = operation - sendData["powerurl"] = "" + sendData["powerid"] = strings.Split(pointId, ",") + sendData["poweroperationid"] = strings.Split(operation, ",") + sendData["powerurl"] = []string{} publicmethod.Result(0, sendData, c) } diff --git a/overall/publicmethod/technique.go b/overall/publicmethod/technique.go index 27f7d3b..905fbc0 100644 --- a/overall/publicmethod/technique.go +++ b/overall/publicmethod/technique.go @@ -1265,13 +1265,13 @@ func GetNewAccredit(systemName, roleId string, userKey, orgId, postId int64) (ro for _, rev := range roleEmpowerCont { menuList := strings.Split(rev.PointId, ",") for _, mv := range menuList { //菜单权限 - if IsInTrue[string](mv, pointIdAry) == false { + if mv != "" && IsInTrue[string](mv, pointIdAry) == false { pointIdAry = append(pointIdAry, mv) } } operList := strings.Split(rev.Operation, ",") for _, ov := range operList { //操作权限 - if IsInTrue[string](ov, operationAry) == false { + if ov != "" && IsInTrue[string](ov, operationAry) == false { operationAry = append(operationAry, ov) } } @@ -1293,7 +1293,7 @@ func GetNewAccredit(systemName, roleId string, userKey, orgId, postId int64) (ro } else { guoduPoin := strings.Split(orgEmpowerCont.PointId, ",") for _, pv := range guoduPoin { //合并权限 - if IsInTrue[string](pv, pointIdAry) == false { + if pv != "" && IsInTrue[string](pv, pointIdAry) == false { pointIdAry = append(pointIdAry, pv) } } @@ -1303,9 +1303,9 @@ func GetNewAccredit(systemName, roleId string, userKey, orgId, postId int64) (ro operationAry = strings.Split(orgEmpowerCont.Operation, ",") } else { guoduOper := strings.Split(orgEmpowerCont.Operation, ",") - for _, pv := range guoduOper { //合并权限 - if IsInTrue[string](pv, operationAry) == false { - operationAry = append(operationAry, pv) + for _, gpv := range guoduOper { //合并权限 + if gpv != "" && IsInTrue[string](gpv, operationAry) == false { + operationAry = append(operationAry, gpv) } }