Пример #1
0
    public void Reload()
    {
        if (PlayerPrefs.GetString("WXUserInfo") != string.Empty)
        {
            _wxData = new WXData();
            var json = JSONNode.Parse(PlayerPrefs.GetString("WXUserInfo"));
            _wxData.Reload(json);

            wxImgUrl = PlayerPrefs.GetString("wxImgUrl");
            wxName   = PlayerPrefs.GetString("wxName");
            IsLogin  = true;
        }
        else
        {
            IsLogin = false;
        }
    }
Пример #2
0
 //请求微信数据
 public void WXRequest(MonoBehaviour mono, Dictionary <string, object> form, string address)
 {
     HttpHelper.Request(mono, address, HttpHelper.MethodType.POST, form,
                        delegate(object value)
     {
         var wxData = new WXData();
         var json   = JSONNode.Parse(value.ToString());
         wxData.Reload(json);
         Debug.Log("postLoginRecord :" + value.ToString());
         form = new Dictionary <string, object>();
         form.Add("access_token", wxData.access_token);
         form.Add("openid", wxData.openId);
         WXReuqestUserInfo(mono, form, CommonConfig.wxAddress);
         SaveWXData(wxData);
         PlayerPrefs.SetString("WXUserInfo", value.ToString());
     }, delegate(object value)
     {
         Debug.Log("postLoginRecord error:" + value.ToString());
     }, HttpHelper.DownloadHanlderType.kHttpTEXT);
 }