极客开通失败

This commit is contained in:
wanyongkang
2020-11-26 17:43:54 +08:00
parent 52524905e5
commit d1c2dc5e89

View File

@@ -182,6 +182,7 @@ namespace Hncore.Pass.Vpn.Service
LogHelper.Info(title, map.ToJson()); LogHelper.Info(title, map.ToJson());
try try
{ {
var resp = await client.GetAsync(this.UserApiUrl + "?" + this.FormatRequest(map)); var resp = await client.GetAsync(this.UserApiUrl + "?" + this.FormatRequest(map));
var content = await resp.Content.ReadAsStringAsync(); var content = await resp.Content.ReadAsStringAsync();
JObject jo = (JObject)JsonConvert.DeserializeObject(content); JObject jo = (JObject)JsonConvert.DeserializeObject(content);
@@ -198,30 +199,10 @@ namespace Hncore.Pass.Vpn.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
ex.GetInfo(); LogHelper.Error(title, ex.GetInfo());
try
{
var resp = await client.GetAsync(this.UserApiUrl + "?" + this.FormatRequest(map));
var content = await resp.Content.ReadAsStringAsync();
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
var status = jo["code"].ToString();
if (status == "1")
{
return new ApiResult(ResultCode.C_SUCCESS);
}
else
{
LogHelper.Error(title, content);
return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败"); return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
} }
} }
catch (Exception exs)
{
LogHelper.Error(title, exs.GetInfo());
return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
}
}
}
/// <summary> /// <summary>
/// 新开测试账号 /// 新开测试账号
/// </summary> /// </summary>
@@ -349,29 +330,9 @@ namespace Hncore.Pass.Vpn.Service
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.Error(title, ex.Message); LogHelper.Error(title, ex.Message);
try
{
var resp = await client.GetAsync(this.UserApiUrl + "?" + this.FormatRequest(map));
var content = await resp.Content.ReadAsStringAsync();
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
var status = jo["code"].ToString();
if (status == "1")
{
return new ApiResult(ResultCode.C_SUCCESS);
}
else
{
LogHelper.Error(title, content);
return new ApiResult(ResultCode.C_INVALID_ERROR, "续费失败"); return new ApiResult(ResultCode.C_INVALID_ERROR, "续费失败");
} }
} }
catch (Exception exs)
{
LogHelper.Error(title, exs.Message);
return new ApiResult(ResultCode.C_INVALID_ERROR, "续费失败");
}
}
}
/// <summary> /// <summary>
/// 删除账号 /// 删除账号
/// </summary> /// </summary>