回 3楼simon龙龙的帖子
C#的案例,
//获取服务窗channeljsapitick
public static string getchanneljsapiticket(string corpId, string channeltoken)
{
if (HttpContext.Current.Cache[corpId + "_channeljsapitick"] != null)
{
return HttpContext.Current.Cache[corpId + "_channeljsapitick"].ToString();
}
string url = "https://oapi.dingtalk.com/service/channel/get_channel_jsapi_ticket?access_token=" + channeltoken;
Hashtable table = getUrl(url);
if (table["errcode"].ToString().Equals("0"))
{
HttpContext.Current.Cache.Insert(corpId + "_channeljsapitick", table["ticket"].ToString(), null, DateTime.Now.AddSeconds(7100), TimeSpan.Zero, CacheItemPriority.Normal, null);
return table["ticket"].ToString();
}
return "";
}