|
@@ -67,6 +67,8 @@ public class ResetUIController : MonoBehaviour
|
|
|
errorMessageDict.Add("wrong_verification_code", textValue);
|
|
|
textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "resetUI", "error_msg", "email_format_wrong", EnviromentSetting.languageCode });
|
|
|
errorMessageDict.Add("email_format_wrong", textValue);
|
|
|
+ textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "resetUI", "error_msg", "too_many_attempts", EnviromentSetting.languageCode });
|
|
|
+ errorMessageDict.Add("too_many_attempts", textValue);
|
|
|
|
|
|
cancel.clicked += CancelClick;
|
|
|
submit.clicked += SubmitClick;
|
|
@@ -127,7 +129,7 @@ public class ResetUIController : MonoBehaviour
|
|
|
else if (sceneCondition.GetHashCode() == 2)
|
|
|
{
|
|
|
// 输入验证码阶段和输入新密码阶段
|
|
|
- NewPassowrdRequest();
|
|
|
+ NewPasswordRequest();
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -168,16 +170,22 @@ public class ResetUIController : MonoBehaviour
|
|
|
}
|
|
|
else if (data != null && data["status"] == "error")
|
|
|
{
|
|
|
+ int errorCode = int.Parse(data["code"]);
|
|
|
// 找不到对应的账户
|
|
|
- if (data["message"] == "cannot find account")
|
|
|
+ if (errorCode == 610)
|
|
|
{
|
|
|
errorText += errorMessageDict["cannot_find_account"];
|
|
|
}
|
|
|
+ // 尝试太多次数
|
|
|
+ if (errorCode == 612)
|
|
|
+ {
|
|
|
|
|
|
+ errorText += errorMessageDict["too_many_attempts"];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void NewPassowrdRequest()
|
|
|
+ void NewPasswordRequest()
|
|
|
{
|
|
|
// 检查验证码
|
|
|
string url = "/api/reset/password/step2/";
|
|
@@ -210,8 +218,9 @@ public class ResetUIController : MonoBehaviour
|
|
|
}
|
|
|
else if (data != null && data["status"] == "error")
|
|
|
{
|
|
|
+ int errorCode = int.Parse(data["code"]);
|
|
|
// 验证码错误
|
|
|
- if (data["message"] == "wrong verification code")
|
|
|
+ if (errorCode == 611)
|
|
|
{
|
|
|
errorText += errorMessageDict["wrong_verification_code"];
|
|
|
}
|