DESKTOP-53URE31\USER 4 месяцев назад
Родитель
Сommit
c7c676a119
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      internal/logic/Wxhook/get_friends_and_groups_logic.go

+ 4 - 4
internal/logic/Wxhook/get_friends_and_groups_logic.go

@@ -67,14 +67,14 @@ func (l *GetFriendsAndGroupsLogic) GetFriendsAndGroups(req *types.IDReq) (resp *
 		serverInfo, err := l.svcCtx.DB.Server.Get(l.ctx, wxInfo.ServerID)
 		if err != nil {
 			l.Error("查询服务器信息失败", err)
-			return
+			return nil, err
 		}
 		hookClient := hook.NewHook(serverInfo.PrivateIP, serverInfo.AdminPort, wxInfo.Port)
 
 		friendAndChatRoomList, err := hookClient.GetFriendAndChatRoomList("0")
 		if err != nil {
 			l.Error("获取好友列表失败", err)
-			return
+			return nil, err
 		}
 		newFriendIds := make(map[uint64][]string)
 		newLagIds := make(map[string]struct{})
@@ -202,12 +202,12 @@ func (l *GetFriendsAndGroupsLogic) GetFriendsAndGroups(req *types.IDReq) (resp *
 		var result GetWechatFriendListResp
 		res, err := reqv3.C().DevMode().R().SetSuccessResult(&result).Post("http://chat.gkscrm.com:13086/pc/GetWechatFriendList?cid=" + wxInfo.Port + "&wechatid=" + wxInfo.Wxid)
 		if err != nil {
-			return
+			return nil, err
 		}
 		if !res.IsSuccessState() {
 			err = fmt.Errorf("GetFriendAndChatRoomList failed with status code %d", res.StatusCode)
 			l.Error("GetWechatFriendList 请求失败", err)
-			return
+			return nil, err
 		}
 		for _, friend := range result.Data {
 			friendType := 1