diff --git a/Storage/Storage.Test/UserTest.cs b/Storage/Storage.Test/UserTest.cs
index 53c9f7b..56cfaca 100644
--- a/Storage/Storage.Test/UserTest.cs
+++ b/Storage/Storage.Test/UserTest.cs
@@ -229,5 +229,17 @@ namespace Storage.Test {
//public async Task ResetPasswordBySMSCode() {
// await LCUser.ResetPasswordBySmsCode("15101006007", "732552", "112358");
//}
+
+ [Test]
+ public async Task RequestSMSCodeForUpdatingPhoneNumber() {
+ await LCUser.Login("hello", "world");
+ await LCUser.RequestSMSCodeForUpdatingPhoneNumber("15101006007");
+ }
+
+ [Test]
+ public async Task VerifyCodeForUpdatingPhoneNumber() {
+ await LCUser.Login("hello", "world");
+ await LCUser.VerifyCodeForUpdatingPhoneNumber("15101006007", "055595");
+ }
}
}
diff --git a/Storage/Storage/LCUser.cs b/Storage/Storage/LCUser.cs
index b86001b..bfd21db 100644
--- a/Storage/Storage/LCUser.cs
+++ b/Storage/Storage/LCUser.cs
@@ -555,5 +555,39 @@ namespace LeanCloud.Storage {
authData["main_account"] = option.AsMainAccount;
authData["unionid"] = unionId;
}
+
+ ///
+ /// 请求修改手机号验证码
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task RequestSMSCodeForUpdatingPhoneNumber(string mobile, int ttl = 360, string captchaToken = null) {
+ string path = "requestChangePhoneNumber";
+ Dictionary data = new Dictionary {
+ { "mobilePhoneNumber", mobile },
+ { "ttl", ttl }
+ };
+ if (!string.IsNullOrEmpty(captchaToken)) {
+ data["validate_token"] = captchaToken;
+ }
+ await LCApplication.HttpClient.Post>(path, data: data);
+ }
+
+ ///
+ /// 验证修改手机号验证码
+ ///
+ ///
+ ///
+ ///
+ public static async Task VerifyCodeForUpdatingPhoneNumber(string mobile, string code) {
+ string path = "changePhoneNumber";
+ Dictionary data = new Dictionary {
+ { "mobilePhoneNumber", mobile },
+ { "code", code }
+ };
+ await LCApplication.HttpClient.Post>(path, data: data);
+ }
}
}