detect/detect.gui/Api/Helpers/UserHelper.cs

18 lines
556 B
C#
Raw Normal View History

2024-11-13 17:09:15 +08:00
using detect.gui.Models;
using detect.gui.Models.Entities;
using Newtonsoft.Json;
namespace detect.gui.Api.Helpers;
public class UserHelper
{
public static ApiResponse<UserEntity>? Login(string? username, string? password)
{
var data = new { Username = username, Password = password };
var param = JsonConvert.SerializeObject(data, new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
});
return ApiHelper.Post<UserEntity>("/v1/system/user/login", param, false);
}
}