1、新建UserDto.cs
public class UserDto : BaseDto
{
private string userName;
/// <summary>
/// 用户名
/// </summary>
public string UserName
{
get { return userName; }
set { userName = value;OnPropertyChanged(); }
}
private string account;
/// <summary>
/// 账户
/// </summary>
public string Account
{
get { return account; }
set { account = value; OnPropertyChanged(); }
}
private string password;
/// <summary>
/// 密码
/// </summary>
public string Password
{
get { return password; }
set { password = value; OnPropertyChanged(); }
}
}
2、新增ILoginService接口
public interface ILoginService
{
Task<ApiResponse> LoginAsync(string Account, string Password);
Task<ApiResponse> RegisterAsync(UserDto userDto);
}
3、实现LoginService接口