/// <summary> /// /// </summary> /// <param name="app"></param> /// <param name="scenePrefix"></param> /// <param name="trycache">当无法获取缓存到的数据时,是否视图获取 场景和关注Url 到缓存;</param> /// <param name="precache">预缓存接口</param> /// <param name="log"></param> /// <param name="precacheCount">预缓存的数量,当数量减少到此数量的一半时,再次获取直到预缓存数量到达此数量;</param> public SceneAndMarkurlFactory(WechatMpApp app, string scenePrefix, bool trycache, long precacheCount, IPrecache <SceneAndMarkurl> precache = null, Action <string> log = null) { this.scenePrefix = scenePrefix; this.trycache = trycache; this.app = app; this.needPrecache = precache != null; this.precacheCount = precacheCount; this.precache = precache; this.log = log; }
/// <summary> /// 注册企业APP信息;注册后才能够正常使用; /// </summary> public void Register() { //WechatMpApp.registerService.RegisterWorkAccount(Config.AppId, Config.AppSecret, "全视物联企业"); //WechatMpApp.RegisterWorkJsApiTicket(Config.AppId, Config.AppSecret, "全视物联企业Js"); if (WechatMpApp.registerService == null) { WechatMpApp.RegisterWeixinConfig(); } AccessTokenContainer.Register(Config.CorpId, Config.AppSecret); JsApiTicketContainer.Register(Config.CorpId, Config.AppSecret); if (!string.IsNullOrEmpty(Config.Token) && !string.IsNullOrEmpty(Config.EncodingAesKey)) { MsgCrypt = new WXBizMsgCrypt(Config.Token, Config.EncodingAesKey, Config.CorpId); } }
static WechatWorkApp() { WechatMpApp.RegisterWeixinConfig(); }