private void getjssignature(HttpContext context) { string appId = PaymentConfig.WeiXinConfig.AppID; long timestamp = (long)((DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds); string nonceStr = "yongyou2016"; string url = context.Request.Params["pageurl"]; if (!url.StartsWith("http")) { url = WebUtil.GetContextPath() + url; } string signature = WeixinHelper.GetJsApiSignature(nonceStr, timestamp, url); WebUtil.WriteJsonResult(context, new { url = url, appId = appId, timestamp = timestamp, nonceStr = nonceStr, signature = signature }); }