public SessionWxResponse GetSession(JSCodeApiToken token) { var app = this.sharingHostService.MerchantDetails .SelectMany(x => x.Apps) .SingleOrDefault(x => x.AppId == token.AppId); token.Secret = app.Secret; return(this.wxapi.GetSession(token)); }
public SessionWxResponse GetSession(JSCodeApiToken token) { var url = string.Format("https://api.weixin.qq.com/sns/jscode2session?appid={0}&js_code={1}&secret={2}&grant_type=authorization_code", token.AppId, token.Code, token.Secret); return(url.GetUriJsonContent <SessionWxResponse>()); //return this.cache.GetOrCreate<SessionWxResponse>( // string.Format("Session_{0}", token.AppId), // (entity) => { // }); }
public SessionWxResponse GetSession(JSCodeApiToken token) { return(client.GetSession(token)); }