You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Learun.Application.WeChat
  7. {
  8. public class OpenTokenGet : OperationRequestBase<OpenTokenGetResult, HttpGetRequest>
  9. {
  10. private string url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code";
  11. protected override string Url()
  12. {
  13. return string.Format(url, appid, secret,code);
  14. }
  15. /// <summary>
  16. /// 应用唯一标识,在微信开放平台提交应用审核通过后获得
  17. /// </summary>
  18. /// <returns></returns>
  19. [IsNotNull]
  20. public string appid { get; set; }
  21. /// <summary>
  22. /// 应用密钥AppSecret,在微信开放平台提交应用审核通过后获得
  23. /// </summary>
  24. /// <returns></returns>
  25. [IsNotNull]
  26. public string secret { get; set; }
  27. /// 填写第一步获取的code参数
  28. /// </summary>
  29. /// <returns></returns>
  30. [IsNotNull]
  31. public string code { get; set; }
  32. }
  33. }