Exemplo n.º 1
0
        public SenparcWeixinSettingItem(ISenparcWeixinSettingForMP setting)
        {
            ItemKey = setting.ItemKey;

            Token           = setting.Token;
            EncodingAESKey  = setting.EncodingAESKey;
            WeixinAppId     = setting.WeixinAppId;
            WeixinAppSecret = setting.WeixinAppSecret;
        }
Exemplo n.º 2
0
 /// <summary>
 /// 根据 SenparcWeixinSetting 自动注册公众号信息(包括JsApi)
 /// </summary>
 /// <param name="registerService">RegisterService</param>
 /// <param name="weixinSettingForMP">SenparcWeixinSetting</param>
 /// <param name="name">统一标识,如果为null,则使用 weixinSettingForMP.ItemKey </param>
 /// <returns></returns>
 public static IRegisterService RegisterMpAccount(this IRegisterService registerService, ISenparcWeixinSettingForMP weixinSettingForMP, string name = null)
 {
     return(RegisterMpAccount(registerService, weixinSettingForMP.WeixinAppId, weixinSettingForMP.WeixinAppSecret, name ?? weixinSettingForMP.ItemKey));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 根据 SenparcWeixinSetting 自动注册公众号信息(包括JsApi)
 /// </summary>
 /// <param name="registerService">RegisterService</param>
 /// <param name="weixinSettingForMP">SenparcWeixinSetting</param>
 /// <param name="name">统一标识,如果为null,则使用 weixinSettingForMP.ItemKey </param>
 /// <returns></returns>
 public static IRegisterService RegisterMpAccount(this IRegisterService registerService, ISenparcWeixinSettingForMP weixinSettingForMP, string name = null)
 {
     //配置全局参数
     if (!string.IsNullOrWhiteSpace(name))
     {
         Config.SenparcWeixinSetting[name] = new SenparcWeixinSettingItem(weixinSettingForMP);
     }
     return(RegisterMpAccount(registerService, weixinSettingForMP.WeixinAppId, weixinSettingForMP.WeixinAppSecret, name ?? weixinSettingForMP.ItemKey));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 根据 SenparcWeixinSetting 自动注册公众号信息(包括JsApi)
 /// </summary>
 /// <param name="registerService">RegisterService</param>
 /// <param name="weixinSettingForMP">SenparcWeixinSetting</param>
 /// <param name="token">token</param>
 /// <param name="encodingAESKey">encodingAESKey</param>
 /// <param name="key">获取公众号信息Key</param>
 /// <param name="name">统一标识,如果为null,则使用 weixinSettingForMP.ItemKey </param>
 /// <param name="userId">用户Id</param>
 /// <param name="tenantId">租户Id</param>
 /// <returns></returns>
 public static IRegisterService UseYoYoSenparcMpAccount(this IRegisterService registerService, ISenparcWeixinSettingForMP weixinSettingForMP, string token, string encodingAESKey, string key, string name = null, long userId = default(long), long tenantId = default(long))
 {
     MpInfoContainer.Register(key, weixinSettingForMP.WeixinAppId, weixinSettingForMP.WeixinAppSecret, token, encodingAESKey, name, userId, tenantId);
     return(registerService.RegisterMpAccount(weixinSettingForMP, name));
 }