Просмотр исходного кода

1、修改备注返回结果集问题

yys 2 месяцев назад
Родитель
Сommit
733151ca41

+ 11 - 4
fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactController.java

@@ -1,6 +1,8 @@
 package com.fs.company.controller.qw;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
@@ -589,12 +591,17 @@ public class QwExternalContactController extends BaseController
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
 
         String url = OpenQwConfig.baseApi + "/edit?tenantId=" + loginUser.getTenantId();
-        String result = HttpUtil.createPost(url)
+        HttpResponse response = HttpRequest.post(url)
                 .body(JSON.toJSONString(qwExternalContact))
-                .execute()
-                .body();
+                .execute();
 
-        return toAjax(Boolean.getBoolean(result));
+
+        if (response.getStatus() == 200) {
+            return JSON.parseObject(response.body(), AjaxResult.class);
+        } else {
+            log.error("删除好友欢迎语失败,HTTP状态码: {}", response.getStatus());
+            return AjaxResult.error("删除好友欢迎语失败,服务返回状态码: " + response.getStatus());
+        }
 //        return toAjax(qwExternalContactService.updateQwExternalContact(qwExternalContact));
     }