Пример #1
0
 private string GetTicket(Account account)
 {
     var ticketUrl = string.Format("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={0}&type=jsapi", account.AccessToken);
     return JsonConvert.DeserializeObject<Ticket>(Tools.HttpGet(ticketUrl)).ticket;
 }
Пример #2
0
 public CustomIdentity(Account user)
 {
     _user = user;
 }
 private OpenIdBackResult GetOpenId(Account account,string Code)
 {
     var url = string.Format("https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code", account.AppId, account.AppSecret, Code);
     return JsonConvert.DeserializeObject<OpenIdBackResult>(Tools.HttpGetUTF8(url));
 }
Пример #4
0
 public void Insert(Account account)
 {
     this.DbContext.Accounts.Add(account);
     this.DbContext.SaveChanges();
 }