Exemplo n.º 1
0
        //[HandlerAjaxOnly]
        public ActionResult GetDingTalkAppConfigJson()
        {
            string            url    = Request.Url.PathAndQuery;
            DingTalkAppConfig config = ding.GetAppConfig("1");

            if (config != null)
            {
                config.TimeStamp = DingTalkHelper.GetTimeStamp();
                config.NonceStr  = "metec";
                string jsapi_ticket = DingTalkHelper.GetJsApiTicket(config.AccessToken);
                config.Signature = DingTalkHelper.GetAccessSignature(config.NonceStr, config.TimeStamp.ToString(), jsapi_ticket, url);
            }
            return(Content(config.ToJson()));
        }
Exemplo n.º 2
0
        private object GetDingTalkCorpConfig(string url)
        {
            DingTalkCorpConfig config = ding.GetAccessToken();

            if (config != null)
            {
                config.TimeStamp = DingTalkHelper.GetTimeStamp();
                config.NonceStr  = DingTalkHelper.GuidTo16String();
                string jsapi_ticket = DingTalkHelper.GetJsApiTicket(config.AccessToken);
                config.url          = url;
                config.jsapi_ticket = jsapi_ticket;
                config.Signature    = DingTalkHelper.GetAccessSignature(config.NonceStr, config.TimeStamp.ToString(), jsapi_ticket, url);
            }
            return(config);
        }
Exemplo n.º 3
0
        //[HandlerAjaxOnly]
        public ActionResult GetDingTalkCorpConfigJson(string url)
        {
            DingTalkCorpConfig config = ding.GetAccessToken();

            if (config != null)
            {
                config.TimeStamp = DingTalkHelper.GetTimeStamp();
                config.NonceStr  = DingTalkHelper.GuidTo16String();
                string jsapi_ticket = DingTalkHelper.GetJsApiTicket(config.AccessToken);
                config.url          = url;
                config.jsapi_ticket = jsapi_ticket;
                config.Signature    = DingTalkHelper.GetAccessSignature(config.NonceStr, config.TimeStamp.ToString(), jsapi_ticket, url);
            }
            return(Content(config.ToJson()));
        }