2025-04-01 13:41:50 +08:00

37 lines
1.1 KiB
C#

using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using RIZO.Client.IDAL;
namespace RIZO.Client.DAL
{
public class UserDal : WebDataAccess, IUserDal
{
public Task<string> GetAll()
{
// 服务接口
return this.GetDatas($"{domain}user/all");
}
public Task<string> GetRolesByUserId(int userId)
{
return this.GetDatas($"{domain}user/roles/{userId}");
}
public Task ResetPassword(string userId)
{
Dictionary<string, HttpContent> param = new Dictionary<string, HttpContent>();
param.Add("userId", new StringContent(userId));
return this.PostDatas($"{domain}user/resetpwd", param);
}
public Task SaveUser(string data)
{
StringContent content = new StringContent(data);
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
return this.PostDatas($"{domain}user/save", content);
}
}
}