FB登录功能暂存;苹果有问题

This commit is contained in:
Caiyanpeng committed 2021-12-24 13:58:14 +08:00
1 parent 6423007638
commit 769b75e2e2
7 files changed
+84 -12

No files matched your search

+50 -6
View File
@@ -507,6 +507,38 @@ public class LoginController : BaseScene
transform.Find("Panel").Find("Version").GetComponent<Text>().text = $"V{App.AppVersion}";
#endif
}
private string fbUserId = "";
private string fbToken = "";
public async void OnFacebookLoginCheck(string userId, string token)
{
fbUserId = userId;
fbToken = token;
signType = 3;
var res = await ConfigHelper.userApi.OnFacebookLoginCheck(userId, token);
if (res.result) //判断是否成功登录
{
var data = JObject.FromObject(res.data);
if (data.ContainsKey("success") && data.Value<string>("success") == "False")
{
goSign();
}
else
{
RefreshWx3(data.ToObject<UserResultModel>(), 1);
wxLogin3.gameObject.SetActive(true);
signContainer.gameObject.SetActive(false);
pageNums = 3;
MobileAni(true);
StartScrollPanel(2);
}
}
else
{
Utils.showToast(null, res.errMsg);
}
}
private string appleUserId = "";
private string appleToken = "";
private int signType { get; set; }
@@ -789,7 +821,7 @@ public class LoginController : BaseScene
//Timer t = new Ti
if (r.result)
{
if (signType == 1 || signType == 2)
if (isThird())
{
if (r.data.Value<bool>("isExist"))
{
@@ -850,7 +882,7 @@ public class LoginController : BaseScene
signForm.cpassword.text = "";
StartScrollSign(0);
}
//0-普通 1-微信 2-苹果
//0-普通 1-微信 2-苹果 3-facebook
private async void goRegNext(int signType = 0)
{
var Email = signForm.email;
@@ -881,9 +913,13 @@ public class LoginController : BaseScene
wxInfoJson.Value<string>("unionId"),
wxInfoJson.Value<string>("openId"));
}
else if (signType == 2)
else if (signType == 2)
{
r = await ConfigHelper.userApi.OnAppleIdLogin(appleUserId,appleToken,Email.text,Password.text,Captcha.text);
r = await ConfigHelper.userApi.OnAppleIdLogin(appleUserId, appleToken, Email.text, Password.text, Captcha.text);
}
else
{
r = await ConfigHelper.userApi.OnFacebookLogin(fbUserId, fbToken, Email.text, Password.text, Captcha.text);
}
if (r != null && r.result)
{
@@ -910,7 +946,11 @@ public class LoginController : BaseScene
//苹果登录
r = await ConfigHelper.userApi.OnAppleIdLogin(appleUserId, appleToken, Email.text, "", Captcha.text);
}
else
else if (signType == 3)
{
r = await ConfigHelper.userApi.OnFacebookLogin(fbUserId, fbToken, Email.text, "", Captcha.text);
}
else
{
r = await ConfigHelper.userApi.OnWebWxLogin(Email.text,
Captcha.text,
@@ -1218,6 +1258,10 @@ public class LoginController : BaseScene
//signPage1.Find("signThird").GetComponent<Button>().onClick.RemoveAllListeners();
//signPage1.Find("signThird").GetComponent<Button>().onClick.AddListener(() => { ; });
}
bool isThird()
{
return signType > 0;
}
/// <summary>
///
/// </summary>
@@ -1247,7 +1291,7 @@ public class LoginController : BaseScene
if (type == 0)
{
pageNums = 4;
if (signType != 2)
if (signType < 2)
{
signType = 0;
}