|
@@ -416,19 +416,23 @@ namespace TEAMModelOS.SDK
|
|
notifyData.body = msgs[1];
|
|
notifyData.body = msgs[1];
|
|
}
|
|
}
|
|
string result = "";
|
|
string result = "";
|
|
- HttpResponseMessage responseMessage = _httpClient.PostAsJsonAsync($"{url}/service/PushNotify", notifyData).Result;
|
|
|
|
- if (responseMessage.StatusCode == HttpStatusCode.OK)
|
|
|
|
- {
|
|
|
|
- string content = responseMessage.Content.ReadAsStringAsync().Result;
|
|
|
|
- result = content;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- result = $"{responseMessage.StatusCode},推送返回的状态码。";
|
|
|
|
|
|
+ try {
|
|
|
|
+ HttpResponseMessage responseMessage = _httpClient.PostAsJsonAsync($"{url}/service/PushNotify", notifyData).Result;
|
|
|
|
+ if (responseMessage.StatusCode == HttpStatusCode.OK)
|
|
|
|
+ {
|
|
|
|
+ string content = responseMessage.Content.ReadAsStringAsync().Result;
|
|
|
|
+ result = content;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ result = $"{responseMessage.StatusCode},推送返回的状态码。";
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception exm) {
|
|
|
|
+ _= _dingDing.SendBotMsg($"{location}站点发送消息异常,{exm.Message}\n{exm.StackTrace}:\n{url}/service/PushNotify \nheader: {token.AccessToken} \nresult:{result}\n params:{notifyData.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
}
|
|
}
|
|
// _dingDing.SendBotMsg($"{location}站点发送消息:\n{url}/service/PushNotify \nheader: {token.AccessToken} \nresult:{result}\n params:{notifyData.ToJsonString()}", GroupNames.成都开发測試群組).GetAwaiter().GetResult();
|
|
// _dingDing.SendBotMsg($"{location}站点发送消息:\n{url}/service/PushNotify \nheader: {token.AccessToken} \nresult:{result}\n params:{notifyData.ToJsonString()}", GroupNames.成都开发測試群組).GetAwaiter().GetResult();
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|