Files
Kg.SeaTime/Service/Application.Web/Common/AutoLogin.cs
2026-05-15 17:08:04 +08:00

22 lines
573 B
C#

using Newtonsoft.Json;
namespace Application.Web;
public class AutoLogin
{
public async Task<TwResult> TwLogin(string code)
{
using HttpClient client = new HttpClient();
// 发送 GET 请求
string url = $"https://m.twbar.cn/api/AppAuto/GetOpenInfo?code={code}";
string responseText = await client.GetStringAsync(url);
return JsonConvert.DeserializeObject<TwResult>(responseText);
}
}
public class TwResult
{
public string msg { get; set; } = "";
public int code { get; set; }
public object data { get; set; }
}