李昊 il y a 4 ans
Parent
commit
1dca5701c5

+ 9 - 8
gx_api/GxPress/Service/GxPress.Service.Implement/UserService.cs

@@ -407,14 +407,15 @@ namespace GxPress.Service.Implement
             var systemLinkModelAttributeResults = new List<UserLinkModelAttributeResult>();
             foreach (var item in addressBookGroupList)
                 systemLinkModelAttributeResults.Add(new UserLinkModelAttributeResult { Id = item.Id, Name = item.GroupName });
-            userLinkResult.Add(
-                new UserLinkModelResult
-                {
-                    TypeId = 3,
-                    Name = "自建通讯录",
-                    Items = systemLinkModelAttributeResults
-                }
-            );
+            if (addressBookGroupList.Count() > 0)
+                userLinkResult.Add(
+                    new UserLinkModelResult
+                    {
+                        TypeId = 3,
+                        Name = "自建通讯录",
+                        Items = systemLinkModelAttributeResults
+                    }
+                );
             //获取用户好友
             var userIds = await friendsRepository.GetFriendsIdsAsync(userId, 0);
             var result = new UserLinkResult()