Пример #1
0
        public ActionResult Audit(string queryJson)
        {
            var queryParam = queryJson.ToJObject();
            TelphoneCertificationEntity entity = new TelphoneCertificationEntity();
            TelphoneCertificationBLL    telphonecertificationbll = new TelphoneCertificationBLL();

            entity.mobileNumber    = queryParam["mobileNumber"].ToString();
            entity.custName        = queryParam["custName"].ToString();
            entity.custCertCode    = queryParam["custCertCode"].ToString();
            entity.custCertAddress = queryParam["custCertAddress"].ToString();
            entity.photo_z         = queryParam["photo_z"].ToString();
            entity.photo_b         = queryParam["photo_b"].ToString();
            entity.photo_s         = queryParam["photo_s"].ToString();
            entity.loadMark        = 0;
            entity.createTime      = DateTime.Now;
            //插入实名认证表
            telphonecertificationbll.SaveForm("", entity);
            //通知指定的微信客服
            #region 获取access_token
            string     apiurl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx24e47efa56c2e554&secret=1f8de99c6304d13e5a65efa418638ee4";
            WebRequest req    = WebRequest.Create(@apiurl);
            req.Method = "POST";
            WebResponse  response = req.GetResponse();
            Stream       stream   = response.GetResponseStream();
            Encoding     encode   = Encoding.UTF8;
            StreamReader reader   = new StreamReader(stream, encode);
            string       detail   = reader.ReadToEnd();
            var          jd       = JsonConvert.DeserializeObject <WXApi>(detail);
            string       token    = (String)jd.access_token;
            #endregion

            //string url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + token;

            //string touser = ConfigurationManager.AppSettings["touser"];
            //string message = "{\"touser\":\"" + touser + "\"," +
            //    "\"msgtype\":\"text\"," +
            //    "\"text\": " +
            //    "{\"content\":\"有客户提交了实名认证资料" +
            //    "\n手机号:" + entity.mobileNumber +
            //    "\n客户名称:" + entity.custName +
            //    "\n身份证:" + entity.custCertCode +
            //    "\n地址:" + entity.custCertAddress +
            //    " \"} }";
            //string str = GetResponseData(message, @url);
            return(Content("true"));
        }