public async Task <JsonResult> SubmitChangeBindingAction(string oldNumber, string newNumber, string vCode) { try { using (var client = new UserAccountClient()) { var result = await client.ChangeBindMobileActionAsync(new UserChangeBindMobileAction { Operator = User.Identity.Name, SourceBindMobile = oldNumber, TargetBindMobile = newNumber, TargetMobileCode = vCode }); result.ThrowIfException(false); if (result.Success && result.Result) { var flag = false; var smsBody = "您的途虎账号已经与本手机号解绑, 如非本人操作请联系客服:400-111-8868【途虎养车】"; // 提交验证码 await Business.Sms.SmsManager.SubmitVerficationCodeAsync(newNumber, vCode); // 模板:您的途虎账号已经与本手机号解绑, 如非本人操作请联系客服:400-111-8868 if (await Business.Sms.SmsManager.SendTemplateSmsMessageAsync(oldNumber, 75)) { flag = true; } await client.LogChangeBindMobileActionAsync( new UserChangeBindMobileLog { SourceBindMobile = oldNumber, TargetBindMobile = newNumber, Operator = User.Identity.Name, OperateStatus = true, CreatedTime = DateTime.Now }); return(flag ? Json("绑定成功但发送确认短信失败") : Json("绑定成功")); } await client.LogChangeBindMobileActionAsync( new UserChangeBindMobileLog { SourceBindMobile = oldNumber, TargetBindMobile = newNumber, Operator = User.Identity.Name, OperateStatus = false, FailReason = result.ErrorMessage, CreatedTime = DateTime.Now }); return(Json(result.ErrorMessage)); } } catch (Exception exception) { WebLog.LogException(exception); return(Json("未知异常")); } }