VideoConcat/Common/Api/Base/SystemApi.cs
2025-08-12 00:13:45 +08:00

35 lines
1011 B
C#

using System.Net;
using VideoConcat.Common.Tools;
namespace VideoConcat.Common.Api.Base
{
public class SystemApi
{
public static async Task<ApiResponse<UserLoginResponse>> LoginAsync<UserLoginResponse>(string username, string password)
{
string pcMachineName = Environment.MachineName;
string pcUserName = Environment.UserName;
string name = Dns.GetHostName();
string ipadrlist = Dns.GetHostAddresses(name)?.ToString()??"";
HttpHelper Http = new();
ApiResponse<UserLoginResponse> res = await Http.PostAsync<UserLoginResponse>("/api/base/login",
new
{
Username = username,
Password = password,
Platform = "pc",
PcName = pcMachineName,
PcUserName = pcUserName,
Ips = ipadrlist
}
);
return res;
}
}
}