|
@@ -85,7 +85,7 @@ public class RegisterView : MonoBehaviour
|
|
|
|
|
|
|
|
private string usrRecord = "";
|
|
private string usrRecord = "";
|
|
|
private string pwdRecord = "";
|
|
private string pwdRecord = "";
|
|
|
- long _lastRegisterNextTime = 0;
|
|
|
|
|
|
|
+ JC.CS.Throttler throttlerRegisterNext = new JC.CS.Throttler(2000);
|
|
|
public void RegisterNext()
|
|
public void RegisterNext()
|
|
|
{
|
|
{
|
|
|
InputField user = GetInputField(registerInUser);
|
|
InputField user = GetInputField(registerInUser);
|
|
@@ -108,11 +108,9 @@ public class RegisterView : MonoBehaviour
|
|
|
PopupMgr.ins.ShowTip("验证码错误");
|
|
PopupMgr.ins.ShowTip("验证码错误");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (JC.CS.Utility.GetTimestamp() - _lastRegisterNextTime < 2000) {
|
|
|
|
|
|
|
+ if (throttlerRegisterNext.CanPass() == false) {
|
|
|
PopupMgr.ins.ShowTip("操作过于频繁");
|
|
PopupMgr.ins.ShowTip("操作过于频繁");
|
|
|
return;
|
|
return;
|
|
|
- } else {
|
|
|
|
|
- _lastRegisterNextTime = JC.CS.Utility.GetTimestamp();
|
|
|
|
|
}
|
|
}
|
|
|
usrRecord = user.text;
|
|
usrRecord = user.text;
|
|
|
pwdRecord = pwd1.text;
|
|
pwdRecord = pwd1.text;
|
|
@@ -127,7 +125,7 @@ public class RegisterView : MonoBehaviour
|
|
|
));
|
|
));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- long _lastRegisterSaveTime = 0;
|
|
|
|
|
|
|
+ JC.CS.Throttler throttlerRegisterSave = new JC.CS.Throttler(2000);
|
|
|
public void RegisterSave() {
|
|
public void RegisterSave() {
|
|
|
InputField nickname = GetInputField(registerInNickname);
|
|
InputField nickname = GetInputField(registerInNickname);
|
|
|
if (nickname.text.Trim().Length == 0) {
|
|
if (nickname.text.Trim().Length == 0) {
|
|
@@ -152,11 +150,9 @@ public class RegisterView : MonoBehaviour
|
|
|
PopupMgr.ins.ShowTip("未填写所在地区");
|
|
PopupMgr.ins.ShowTip("未填写所在地区");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (JC.CS.Utility.GetTimestamp() - _lastRegisterSaveTime < 2000) {
|
|
|
|
|
|
|
+ if (throttlerRegisterSave.CanPass() == false) {
|
|
|
PopupMgr.ins.ShowTip("操作过于频繁");
|
|
PopupMgr.ins.ShowTip("操作过于频繁");
|
|
|
return;
|
|
return;
|
|
|
- } else {
|
|
|
|
|
- _lastRegisterSaveTime = JC.CS.Utility.GetTimestamp();
|
|
|
|
|
}
|
|
}
|
|
|
StartCoroutine(LoginController.ins.CompleteUserInfo(
|
|
StartCoroutine(LoginController.ins.CompleteUserInfo(
|
|
|
usrRecord, pwdRecord, nickname.text, gender, birthday.text,
|
|
usrRecord, pwdRecord, nickname.text, gender, birthday.text,
|