Browse Source

修改系统授权

v1_dev_2
超级管理员 3 years ago
parent
commit
c93c60ca31
  1. 7
      api/version1/empower/system_license.go
  2. 12
      overall/publicmethod/technique.go

7
api/version1/empower/system_license.go

@ -2,6 +2,7 @@ package empower
import ( import (
"key_performance_indicators/overall/publicmethod" "key_performance_indicators/overall/publicmethod"
"strings"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -42,8 +43,8 @@ func (a *ApiMethod) ObtainAuthorization(c *gin.Context) {
// return // return
// } // }
sendData := publicmethod.MapOut[string]() sendData := publicmethod.MapOut[string]()
sendData["powerid"] = pointId sendData["powerid"] = strings.Split(pointId, ",")
sendData["poweroperationid"] = operation sendData["poweroperationid"] = strings.Split(operation, ",")
sendData["powerurl"] = "" sendData["powerurl"] = []string{}
publicmethod.Result(0, sendData, c) publicmethod.Result(0, sendData, c)
} }

12
overall/publicmethod/technique.go

@ -1265,13 +1265,13 @@ func GetNewAccredit(systemName, roleId string, userKey, orgId, postId int64) (ro
for _, rev := range roleEmpowerCont { for _, rev := range roleEmpowerCont {
menuList := strings.Split(rev.PointId, ",") menuList := strings.Split(rev.PointId, ",")
for _, mv := range menuList { //菜单权限 for _, mv := range menuList { //菜单权限
if IsInTrue[string](mv, pointIdAry) == false { if mv != "" && IsInTrue[string](mv, pointIdAry) == false {
pointIdAry = append(pointIdAry, mv) pointIdAry = append(pointIdAry, mv)
} }
} }
operList := strings.Split(rev.Operation, ",") operList := strings.Split(rev.Operation, ",")
for _, ov := range operList { //操作权限 for _, ov := range operList { //操作权限
if IsInTrue[string](ov, operationAry) == false { if ov != "" && IsInTrue[string](ov, operationAry) == false {
operationAry = append(operationAry, ov) operationAry = append(operationAry, ov)
} }
} }
@ -1293,7 +1293,7 @@ func GetNewAccredit(systemName, roleId string, userKey, orgId, postId int64) (ro
} else { } else {
guoduPoin := strings.Split(orgEmpowerCont.PointId, ",") guoduPoin := strings.Split(orgEmpowerCont.PointId, ",")
for _, pv := range guoduPoin { //合并权限 for _, pv := range guoduPoin { //合并权限
if IsInTrue[string](pv, pointIdAry) == false { if pv != "" && IsInTrue[string](pv, pointIdAry) == false {
pointIdAry = append(pointIdAry, pv) pointIdAry = append(pointIdAry, pv)
} }
} }
@ -1303,9 +1303,9 @@ func GetNewAccredit(systemName, roleId string, userKey, orgId, postId int64) (ro
operationAry = strings.Split(orgEmpowerCont.Operation, ",") operationAry = strings.Split(orgEmpowerCont.Operation, ",")
} else { } else {
guoduOper := strings.Split(orgEmpowerCont.Operation, ",") guoduOper := strings.Split(orgEmpowerCont.Operation, ",")
for _, pv := range guoduOper { //合并权限 for _, gpv := range guoduOper { //合并权限
if IsInTrue[string](pv, operationAry) == false { if gpv != "" && IsInTrue[string](gpv, operationAry) == false {
operationAry = append(operationAry, pv) operationAry = append(operationAry, gpv)
} }
} }

Loading…
Cancel
Save