蘑菇
This commit is contained in:
@@ -41,27 +41,7 @@ namespace Hncore.Pass.Vpn.Service
|
|||||||
|
|
||||||
public override async Task<int> RefrushStatus()
|
public override async Task<int> RefrushStatus()
|
||||||
{
|
{
|
||||||
int status = 0;
|
return 1;
|
||||||
if (this.Token.Has())
|
|
||||||
{
|
|
||||||
var client = CreateHttpClient();
|
|
||||||
if (this.RefrushTokenUrl.Has())
|
|
||||||
{
|
|
||||||
// client.DefaultRequestHeaders.Add("Cookie", this.Token);
|
|
||||||
var getResp = await client.GetAsync(this.RefrushTokenUrl);
|
|
||||||
var content = await getResp.Content.ReadAsStringAsync();
|
|
||||||
if (getResp.StatusCode == HttpStatusCode.OK && content.IndexOf("agentLogin.html") == -1)
|
|
||||||
{
|
|
||||||
status = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.WriteLine("离线");
|
|
||||||
Debug.WriteLine(content);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
public override async Task<(byte[], string)> GetCode()
|
public override async Task<(byte[], string)> GetCode()
|
||||||
{
|
{
|
||||||
@@ -78,22 +58,7 @@ namespace Hncore.Pass.Vpn.Service
|
|||||||
return (null, "");
|
return (null, "");
|
||||||
}
|
}
|
||||||
public override async Task<ApiResult> Login(AgentLoginRequest request)
|
public override async Task<ApiResult> Login(AgentLoginRequest request)
|
||||||
{
|
{
|
||||||
var client = CreateHttpClient(false);
|
|
||||||
|
|
||||||
var map = new Dictionary<string, string>(){
|
|
||||||
{"secret_id","yLeKmE6swXSk84VS" },
|
|
||||||
{"secret_key","bQYKH5hV5kcQ4bjaDHJBgM8PeUe82gwr" },
|
|
||||||
};
|
|
||||||
LogHelper.Info("Login", map.ToJson());
|
|
||||||
AddCookie(client, request.Key);
|
|
||||||
//client.DefaultRequestHeaders.Add("Cookie", request.Key);
|
|
||||||
var resp = await client.PostAsForm(this.LoginUrl, map);
|
|
||||||
var content = await resp.Content.ReadAsStringAsync();
|
|
||||||
if (content.IndexOf("alert alert-danger") != -1)
|
|
||||||
{
|
|
||||||
return new ApiResult(ResultCode.C_VISITOR_CHECKING, "登录失败");
|
|
||||||
}
|
|
||||||
return new ApiResult(request.Key);
|
return new ApiResult(request.Key);
|
||||||
}
|
}
|
||||||
public override bool CheckAccount(int productId,List<string> accounts)
|
public override bool CheckAccount(int productId,List<string> accounts)
|
||||||
|
|||||||
Reference in New Issue
Block a user