|
|
|
@ -218,8 +218,8 @@ namespace DSWeb.Areas.CommMng.Controllers
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//[System.Web.Mvc.HttpPost]
|
|
|
|
|
public HttpResponseMessage DingdingCallback(string signature, string timestamp, string nonce)
|
|
|
|
|
[System.Web.Mvc.HttpPost]
|
|
|
|
|
public string DingdingCallback(string signature, string timestamp, string nonce)
|
|
|
|
|
{
|
|
|
|
|
//JeffSoft.Logger.Error("DingdingCallback Success:" + signature + "," + timestamp + "");
|
|
|
|
|
|
|
|
|
@ -233,7 +233,7 @@ namespace DSWeb.Areas.CommMng.Controllers
|
|
|
|
|
strJson.Append(line);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BasicDataRefDAL.SaveLog("["+signature+"]["+ timestamp+"]["+ nonce+"]"+"["+ strJson + "]", Session["USERID"].ToString(), "钉钉回调", "保存");
|
|
|
|
|
//BasicDataRefDAL.SaveLog("["+signature+"]["+ timestamp+"]["+ nonce+"]"+"["+ strJson + "]", "admin", "钉钉回调", "保存");
|
|
|
|
|
|
|
|
|
|
//反序列化json串拿去加密字符串
|
|
|
|
|
var objRtn = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(strJson.ToString(), new { encrypt = "" });
|
|
|
|
@ -245,8 +245,13 @@ namespace DSWeb.Areas.CommMng.Controllers
|
|
|
|
|
//定义字符串接收解密后的值
|
|
|
|
|
string text = dingTalkEncryptor.getDecryptMsg(signature, timestamp, nonce, ever);
|
|
|
|
|
//JeffSoft.Logger.Error("dingTalkEncryptor.getDecryptMsg:" + text + "");
|
|
|
|
|
BasicDataRefDAL.SaveLog( text , "admin", "钉钉回调", "保存1");
|
|
|
|
|
|
|
|
|
|
var objRtn2 = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(text.ToString(), new { EventType = "" });
|
|
|
|
|
|
|
|
|
|
var _jsstr = JsonConvert.Serialize(objRtn2);
|
|
|
|
|
|
|
|
|
|
BasicDataRefDAL.SaveLog(_jsstr, "admin", "钉钉回调", "保存2");
|
|
|
|
|
//取出事件类型字段
|
|
|
|
|
//JeffSoft.Logger.Error("DingdingCallback Success,EventType:" + EventType + "");
|
|
|
|
|
//第二部分
|
|
|
|
@ -258,6 +263,10 @@ namespace DSWeb.Areas.CommMng.Controllers
|
|
|
|
|
var DDtitle = DingCallBackMsg.title;
|
|
|
|
|
var DDresult = DingCallBackMsg.result;
|
|
|
|
|
var mes = string.Format("bpms_instance_change Success,title:{0},result:{1}", DDtitle, DDresult);
|
|
|
|
|
|
|
|
|
|
var _jsstr3 = JsonConvert.Serialize(objRtn2);
|
|
|
|
|
BasicDataRefDAL.SaveLog(_jsstr, "admin", "钉钉回调", "保存3");
|
|
|
|
|
|
|
|
|
|
//JeffSoft.Logger.Error(mes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -279,11 +288,7 @@ namespace DSWeb.Areas.CommMng.Controllers
|
|
|
|
|
// return Json(obj);
|
|
|
|
|
var data = Newtonsoft.Json.JsonConvert.SerializeObject(v);
|
|
|
|
|
|
|
|
|
|
//返回json数
|
|
|
|
|
return new HttpResponseMessage()
|
|
|
|
|
{
|
|
|
|
|
Content = new StringContent(data, Encoding.UTF8, "application/json"),
|
|
|
|
|
};
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|