private void login() { //QuickTips.ShowRedQuickTips("消息"); //HallPanel.Instance.load(); if (!_toggle.isOn) { QuickTips.ShowQuickTipsNor("请同意用户协议"); return; } #if !UNITY_EDITOR if (GameConst.isGuest) { ProtoReq.LoginReq(GameConst.isGuest, _accInput.text.ToZhuan(), _accInput.text.ToZhuan(), 0, "htttp://test", _nameInput.text); } else { //SDKMgr.Instance.GetUserInfo();Authorize SDKMgr.Instance.GetUserInfo(); } #else if (string.IsNullOrEmpty(_accInput.text) || string.IsNullOrEmpty(_nameInput.text)) { QuickTips.ShowQuickTipsNor("输入有误"); } else { ProtoReq.LoginReq(GameConst.isGuest, _accInput.text.ToZhuan(), _nameInput.text, 0, "htttp://test"); } #endif }
private void updateUserInfo(string openId, string unionId, string nickName, int sex, string imageUrl) { Debug.LogError("收到微信,准备登录服务器"); PlayerPrefs.SetString("openId", openId); MainRole.Instance.Name = nickName; string imageUrlAfter = ""; if (!string.IsNullOrEmpty(imageUrl)) { imageUrlAfter = imageUrl.Substring(0, imageUrl.Length - 1) + "46"; } ProtoReq.LoginReq(GameConst.isGuest, openId, nickName, sex, imageUrlAfter); }
public override void InitPanel(Transform uiSprite) { base.InitPanel(uiSprite); _login = uiSprite.FindChild("login").GetComponent <Button>(); _zc = uiSprite.FindChild("zc").GetComponent <Button>(); _close = uiSprite.FindChild("CloseBtn").GetComponent <Button>(); _name = uiSprite.FindChild("name").GetComponent <InputField>(); _password = uiSprite.FindChild("password").GetComponent <InputField>(); _login.onClick.AddListener(delegate { if (string.IsNullOrEmpty(_name.text) || string.IsNullOrEmpty(_password.text)) { QuickTips.ShowQuickTipsNor("用户名或密码不能为空"); return; } ProtoReq.LoginReq(GameConst.isGuest, _name.text.ToZhuan(), _name.text.ToZhuan(), 0, "htttp://test", _password.text); //DestoryPanel(); ClosePanel(); }); _zc.onClick.AddListener(delegate { if (string.IsNullOrEmpty(_name.text) || string.IsNullOrEmpty(_password.text)) { QuickTips.ShowQuickTipsNor("用户名或密码不能为空"); return; } ProtoReq.zc(_name.text, _password.text); }); _close.onClick.AddListener(delegate { ClosePanel(); }); }