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 (
"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)
}

12
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)
}
}

Loading…
Cancel
Save