using UnityEngine; using System.Collections; public static class WXData { const string _appId = "wx975814d4e41392ee"; const string _appSecret = "6a054c246a7fd0242814b89cd2685917"; static string _accessToken; static string _refreshToken; static string _openid; //------------------------------------------------------------- public static string GetApplyTokenURL(string code) { return string.Format("https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code", _appId, _appSecret, code); } //------------------------------------------------------------- public static string GetCheckTokenURL() { return string.Format("https://api.weixin.qq.com/sns/auth?access_token={0}&openid={1}", _accessToken, _openid); } //------------------------------------------------------------- public static string GetRefreshTokenURL() { return string.Format("https://api.weixin.qq.com/sns/oauth2/refresh_token?appid={0}&grant_type=refresh_token&refresh_token={1}", _appId, _refreshToken); } //------------------------------------------------------------- public static string GetUserInfoURL() { return string.Format("https://api.weixin.qq.com/sns/userinfo?access_token={0}&openid={1}", _accessToken, _openid); } //------------------------------------------------------------- public static string RefreshToken { set { _refreshToken = value; } get { return _refreshToken; } } //------------------------------------------------------------- public static string AccessToken { set { _accessToken = value; } get { return _accessToken; } } public static string OpenID { set { _openid = value; } get { return _openid; } } }