/// <summary>
        /// 获取默认微信信息
        /// </summary>
        /// <returns></returns>
        public MAccess_Token GetDefaultWeixinInfo()
        {
            if (Access_TokenInfoDic.ContainsKey(AppSettingFactory.GetAppID()))
            {
                if (String.IsNullOrEmpty(Access_TokenInfoDic[AppSettingFactory.GetAppID()].Access_Token) || DateTime.Now >= Access_TokenInfoDic[AppSettingFactory.GetAppID()].OutTime)
                {
                    RefeshToken(AppSettingFactory.GetAppID());
                }

                return(Access_TokenInfoDic[AppSettingFactory.GetAppID()]);
            }
            else
            {
                return(new MAccess_Token()
                {
                    AppID = AppSettingFactory.GetAppID(), AppSecret = AppSettingFactory.GetAppSecret(), WeixinID = AppSettingFactory.GetWeixinID()
                });
            }
        }
Example #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public ApiRequestBase()
 {
     this.WeixinParam = new MWeixinParam(AppSettingFactory.GetAppID(), AppSettingFactory.GetAppSecret());
 }