public static void QQ_auth_code(object re)
    {
        string code = (string)re;
//		string param = "code=" + code;
        string param = "pf=" + PlatForm.inst.pf;

        param += "|utype=" + Ex_Local.LOGIN_TYPE_QQ;
        param += "|ustr=" + code;
//		param += "|pwd=" + pwd;
        PlatForm.inst.GetSdk().Call(Ex_Local.TRACE, new string[] { "QQ_auth_code :: " + param }, null);
        NetHttp.inst.Send(NetBase.HTTP_LOGIN, param, (VoHttp v) => {
            Dictionary <string, object> user = (Dictionary <string, object>)v.data;
            ModelManager.inst.userModel.SetData(user);
            //
            LocalStore.SetLocal(LocalStore.LOCAL_TYPE, Ex_Local.LOGIN_TYPE_QQ);
            //
            LocalStore.SetUids(ModelManager.inst.userModel.uid, ModelManager.inst.userModel.uname, ModelManager.inst.userModel.pwd, Ex_Local.LOGIN_TYPE_QQ, headstr);
            //
            LocalStore.Set_QQ_Info(ModelManager.inst.userModel.uid, LocalStore.GetLocal(LocalStore.QQ_OPENID), LocalStore.GetLocal(LocalStore.QQ_TOKEN), LocalStore.GetLocal(LocalStore.QQ_DATE));

            LocalStore.SetLocal(LocalStore.LOCAL_UID, ModelManager.inst.userModel.uid);
            LocalStore.SetLocal(LocalStore.LOCAL_PWD, ModelManager.inst.userModel.pwd);
//			LocalStore.SetLocal (LocalStore.LOCAL_UNAME,userModel.uname);
            LocalStore.SetLocal(LocalStore.OTHER_HEADIMG + ModelManager.inst.userModel.uid, LocalStore.GetLocal(LocalStore.OTHER_HEADIMG));
            DispatchManager.inst.Dispatch(new MainEvent(MainEvent.RELOGIN_GAME));
        });
    }
Beispiel #2
0
    private void Set_LocalData(Dictionary <string, object> pf, Dictionary <string, object> user)
    {
        LocalStore.SetLocal(LocalStore.LOCAL_TYPE, Type_Bingding);
        LocalStore.SetLocal(LocalStore.LOCAL_PWD, (string)user ["pwd"]);
        if (Type_Bingding == Ex_Local.LOGIN_TYPE_QQ)
        {
            LocalStore.Set_QQ_Info(userModel.uid, LocalStore.GetLocal(LocalStore.QQ_OPENID), LocalStore.GetLocal(LocalStore.QQ_TOKEN), LocalStore.GetLocal(LocalStore.QQ_DATE));

//			LocalStore.DelUids(userModel.uid);
            LocalStore.SetUids(userModel.uid, userModel.uname, (string)user ["pwd"], Type_Bingding, LocalStore.GetLocal(LocalStore.OTHER_HEADIMG));

            Update_headimg(headstr);
        }
        else if (Type_Bingding == Ex_Local.LOGIN_TYPE_WEIXIN)
        {
            LocalStore.Set_WX_Info(userModel.uid, (string)pf ["openid"], (string)pf ["access_token"], (string)pf ["refresh_token"]);

            PlatForm.inst.GetSdk().Call(Ex_Local.CALL_AUTH_HEAD_GET_WEIXIN, null, Headimg_getWX); //微信绑定之后才能拿到头像

            PlatForm.inst.GetSdk().WX_auth_info("");                                              //微信 找头像
        }
    }