瀏覽代碼

fix:权限显示

zqbao 9 月之前
父節點
當前提交
cae0db57df
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      controllers/user.go

+ 7 - 0
controllers/user.go

@@ -579,14 +579,21 @@ func (this *UserAuthController) PermissionList() {
 			}
 		}
 	}
+	privateAloneView := make([]*models.ChartPermissionTreeView, 0)
 	for _, vi := range privateView {
+		isHas := false
 		for _, vb := range publicView {
 			if vi.ChartPermissionId == vb.ChartPermissionId {
+				isHas = true
 				vb.Child = append(vb.Child, vi.Child...)
 				break
 			}
 		}
+		if !isHas {
+			privateAloneView = append(privateAloneView, vi)
+		}
 	}
+	publicView = append(publicView, privateAloneView...)
 
 	br.Data = publicView
 	br.Msg = "查询成功"