public static Utility.MobileWechatModel[] GetConfigList()
 {
     for (int i = 0; i < 3; i++)
     {
         if (config_list != null)
         {
             break;
         }
         try
         {
             string result = MessageProcessor.Post(null, new Dictionary <string, string>()
             {
                 { "visit", "getwechatconfig" }
             });
             LogHelper.WriteInfo("WechatConfig", "getwechatconfig: " + result);
             Utility.MobileWechatModelResponse response = JsonConvert.DeserializeObject <Utility.MobileWechatModelResponse>(result);
             if (response.status)
             {
                 config_list = response.list;
             }
         }
         catch (Exception ex)
         {
             LogHelper.WriteError("WechatConfig", "getwechatconfig", ex);
         }
     }
     if (config_list == null)
     {
         config_list = new Utility.MobileWechatModel[] { };
     }
     return(config_list);
 }
Exemple #2
0
        private void getwechatconfig(HttpContext context)
        {
            List <Utility.MobileWechatModel> list = new List <Utility.MobileWechatModel>();

            Utility.MobileWechatModel item = new Utility.MobileWechatModel();
            item.Name  = "AppID";
            item.Value = PaymentConfig.WeiXinConfig.AppID;
            list.Add(item);
            item       = new Utility.MobileWechatModel();
            item.Name  = "AppSecret";
            item.Value = PaymentConfig.WeiXinConfig.AppSecret;
            list.Add(item);
            item       = new Utility.MobileWechatModel();
            item.Name  = "Token";
            item.Value = PaymentConfig.WeiXinConfig.Token;
            list.Add(item);
            WebUtil.WriteJson(context, new { status = true, list = list });
        }