增加
This commit is contained in:
22
Service/Application.Web/Common/AutoLogin.cs
Normal file
22
Service/Application.Web/Common/AutoLogin.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
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; }
|
||||
}
|
||||
Reference in New Issue
Block a user