先锋开测试卡
This commit is contained in:
@@ -87,40 +87,26 @@ namespace Hncore.Pass.Vpn.Service
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<ApiResult> NewTestAccount(string packageKey, string account, string pwd, int connCount = 1, int accountType = 1, int payCount = 1)
|
public async Task<ApiResult> NewTestAccount(string packageKey, string account, string pwd, int connCount = 1, int accountType = 1, int payCount = 1)
|
||||||
{
|
{
|
||||||
var client = CreateHttpClient();
|
var secretId = "626B6170693231";
|
||||||
var map = new Dictionary<string, string>(){
|
var secretKey = "6b3fdfc206841f44c6609bf19c182a6a";
|
||||||
{"taocanName",packageKey },
|
|
||||||
{"username",account },
|
|
||||||
{"password",pwd },
|
|
||||||
{"maxonline",connCount.ToString()},
|
|
||||||
{"type",accountType.ToString()},
|
|
||||||
{"tel","17719092232"}
|
|
||||||
};
|
|
||||||
var title = GetOpTitle("NewAccount", account);
|
|
||||||
LogHelper.Info(title, map.ToJson());
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var resp = await client.PostAsForm(this.SingleAddUrl, map);
|
|
||||||
var content = await resp.Content.ReadAsStringAsync();
|
|
||||||
|
|
||||||
Console.WriteLine("====================================在线=================================================");
|
var url = "http://bkapi.pptp.biz/userapi3/?secretId="+secretId+"&secretKey="+secretKey+"&type=addtestuser&user="+account+"&password="+pwd+"&username3=admin01";
|
||||||
Console.WriteLine(content);
|
|
||||||
Console.WriteLine("=====================================================================================");
|
var client = CreateHttpClient();
|
||||||
if (content.Has() && content.IndexOf("{alert(\"成功\")") != -1)
|
|
||||||
{
|
var resp = await client.GetAsync(url);
|
||||||
return new ApiResult(ResultCode.C_SUCCESS);
|
var content = await resp.Content.ReadAsStringAsync();
|
||||||
}
|
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||||
else
|
var status = jo["code"].ToString();
|
||||||
{
|
|
||||||
LogHelper.Error(title, content);
|
|
||||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
|
|
||||||
}
|
|
||||||
}
|
if (status =="1")
|
||||||
catch (Exception ex)
|
|
||||||
{
|
{
|
||||||
LogHelper.Error(title, ex.Message);
|
return new ApiResult(ResultCode.C_SUCCESS);
|
||||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
|
|
||||||
}
|
}
|
||||||
|
return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user