|
@@ -21,6 +21,7 @@ type HomeController struct {
|
21
|
21
|
}
|
22
|
22
|
|
23
|
23
|
func (this *HomeController) GetHomeData() {
|
|
24
|
+
|
24
|
25
|
adminUserInfo := this.GetMobileAdminUserInfo()
|
25
|
26
|
if adminUserInfo.Org != nil && adminUserInfo.Org.Id != 0 {
|
26
|
27
|
|
|
@@ -72,13 +73,14 @@ func (this *HomeController) GetHomeData() {
|
72
|
73
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
73
|
74
|
return
|
74
|
75
|
}
|
75
|
|
-
|
|
76
|
+ cretor := adminUserInfo.AdminUser.Id
|
76
|
77
|
this.ServeSuccessJSON(map[string]interface{}{
|
77
|
78
|
"orgs": orgs,
|
78
|
79
|
"apps": apps,
|
79
|
80
|
"banners": banners,
|
80
|
81
|
"isCreateOrg": true,
|
81
|
82
|
"isSubSuperAdmin": isSubSuperAdmin,
|
|
83
|
+ "cretor": cretor,
|
82
|
84
|
})
|
83
|
85
|
} else {
|
84
|
86
|
apps, err := service.GetAllApp(0)
|
|
@@ -713,3 +715,20 @@ func RemoveRepeatedPurviewElement2(arr []string) (newArr []string) {
|
713
|
715
|
}
|
714
|
716
|
return
|
715
|
717
|
}
|
|
718
|
+
|
|
719
|
+func RemoveRepeatedOrgElementTwo(orgs []*models.SgjUserOrg) (newOrgs []*models.SgjUserOrg) {
|
|
720
|
+ newOrgs = make([]*models.SgjUserOrg, 0)
|
|
721
|
+ for i := 0; i < len(orgs); i++ {
|
|
722
|
+ repeat := false
|
|
723
|
+ for j := i + 1; j < len(orgs); j++ {
|
|
724
|
+ if orgs[i].ID == orgs[j].ID {
|
|
725
|
+ repeat = true
|
|
726
|
+ break
|
|
727
|
+ }
|
|
728
|
+ }
|
|
729
|
+ if !repeat {
|
|
730
|
+ newOrgs = append(newOrgs, orgs[i])
|
|
731
|
+ }
|
|
732
|
+ }
|
|
733
|
+ return
|
|
734
|
+}
|