/// <summary> /// 注册 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// 注意,注册和每次更新用户数据应该存储用户Token,PhoneNumber,EmailAddress private async void btnRegister_Click(object sender, RoutedEventArgs e) { if (txtAccount_reg.Text.Length <= 0 || txtEmail_reg.Text.Length <= 0 || txtPhone_reg.Text.Length <= 0 || txtPhone_reg.Text.Length <= 0) { await new MessageBox("缺少必填字段", MessageBox.NotifyType.CommonMessage).ShowAsync(); return; } UserAccountHelper.RegisterStatus status = await UserAccountHelper.Register(txtAccount_reg.Text, txtEmail_reg.Text, txtPhone_reg.Text, txtPassword_reg.Password); if (status == UserAccountHelper.RegisterStatus.Success) { await new MessageBox("注册成功!", MessageBox.NotifyType.CommonMessage).ShowAsync(); } else if (status == UserAccountHelper.RegisterStatus.ConflictUserName) { await new MessageBox("已存在的用户名,更换用户名重试!", MessageBox.NotifyType.CommonMessage).ShowAsync(); } else if (status == UserAccountHelper.RegisterStatus.Failed) { await new MessageBox("注册失败!", MessageBox.NotifyType.CommonMessage).ShowAsync(); } }