强子迅联更新
This commit is contained in:
@@ -288,7 +288,7 @@
|
||||
|
||||
|
||||
<div style="font-size: 15px;">
|
||||
<h3 style="margin-top: 0px;margin-bottom: 10px;display:inline;color:red;">聚IP新年活动:</h3><a style="cursor:pointer;display:inline;float:right;" onclick="know()">X</a>
|
||||
<h3 style="margin-top: 0px;margin-bottom: 10px;display:inline;color:red;">强子IP升级通知:强子IP线路表和账号已全部恢复正常。客户端预计今天下午会3点之前更新完成。暂时需要用电脑客户端的,请到下载页面下载(通用版电脑拨号器),新版客户端上线后官网会发出通知。敬请关注!给大家带来不便,随后会给大家补偿时间!</h3><a style="cursor:pointer;display:inline;float:right;" onclick="know()">X</a>
|
||||
<p style="margin-top: 10px;">1.动态IP一毛钱一天,每用户限一次。</p>
|
||||
<p>2.月卡送一周,双月卡送一个月,季卡送两个月,部分产品参加。</p>
|
||||
<p>3.新上蘑菇IP,西瓜IP,新上安卓APP。</p>
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
<script src="js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
// 注册登录弹窗开始
|
||||
|
||||
$(".regLink").click(function () {
|
||||
@@ -676,7 +677,7 @@
|
||||
|
||||
|
||||
<div style="font-size: 15px;">
|
||||
<h3 style="margin-top: 0px;margin-bottom: 10px;display:inline;color:red;">聚IP新年活动:</h3><a style="cursor:pointer;display:inline;float:right;" onclick="know()">X</a>
|
||||
<h3 style="margin-top: 0px;margin-bottom: 10px;display:inline;color:red;">强子IP升级通知:强子IP线路表和账号已全部恢复正常。客户端预计今天下午会3点之前更新完成。暂时需要用电脑客户端的,请到下载页面下载(通用版电脑拨号器),新版客户端上线后官网会发出通知。敬请关注!给大家带来不便,随后会给大家补偿时间!</h3><a style="cursor:pointer;display:inline;float:right;" onclick="know()">X</a>
|
||||
<p style="margin-top: 10px;">1.动态IP一毛钱一天,每用户限一次。</p>
|
||||
<p>2.月卡送一周,双月卡送一个月,季卡送两个月,部分产品参加。</p>
|
||||
<p>3.新上蘑菇IP,西瓜IP,新上安卓APP。</p>
|
||||
|
||||
@@ -574,10 +574,10 @@
|
||||
@* @if(item.Product.Id == 14){
|
||||
<p class="youhuiNew">月卡赠送7天,双月卡赠送1个月,仅限新开账号,续费帐号不赠送,活动截止时间2020年12月1日。<br>(同一个IP账号仅限一次,每位会员不限账号数量,您可购买多个IP账号都有赠送)</p>
|
||||
} *@
|
||||
@* @if(item.Product.Id == 1){
|
||||
<p class="youhuiNew">月卡送1周,双月卡赠送1个月,新开和续费都有赠送<br>(同一个IP账号不限次数,您可对同一账号多次续费都有赠送,每位会员不限账号数量,您可购买多个IP账号都有赠送)</p>
|
||||
@if(item.Product.Id == 1){
|
||||
<p class="youhuiNew">公告:<br>强子IP升级通知:强子IP线路表和账号已全部恢复正常。客户端预计今天下午会3点之前更新完成。暂时需要用电脑客户端的,请到下载页面下载(通用版电脑拨号器),新版客户端上线后官网会发出通知。敬请关注!给大家带来不便,随后会给大家补偿时间!</p>
|
||||
}
|
||||
@if(item.Product.Id == 2){
|
||||
@* @if(item.Product.Id == 2){
|
||||
<p class="youhuiNew">月卡送1周,双月卡赠送1个月,新开和续费都有赠送<br>(同一个IP账号不限次数,您可对同一账号多次续费都有赠送,每位会员不限账号数量,您可购买多个IP账号都有赠送)</p>
|
||||
} *@
|
||||
@* @if(item.Product.Id == 6){
|
||||
|
||||
@@ -322,10 +322,10 @@
|
||||
@* @if(defaultProduct.Id == 14){
|
||||
<p class="youhuiNew">月卡赠送7天,双月卡赠送1个月,仅限新开账号,续费帐号不赠送,活动截止时间2020年12月1日。<br>(同一个IP账号仅限一次,每位会员不限账号数量,您可购买多个IP账号都有赠送)</p>
|
||||
} *@
|
||||
@* @if(defaultProduct.Id == 1){
|
||||
<p class="youhuiNew">月卡送1周,双月卡赠送1个月,新开和续费都有赠送<br>(同一个IP账号不限次数,您可对同一账号多次续费都有赠送,每位会员不限账号数量,您可购买多个IP账号都有赠送)</p>
|
||||
@if(defaultProduct.Id == 1){
|
||||
<p class="youhuiNew">公告:<br>强子IP升级通知:强子IP线路表和账号已全部恢复正常。客户端预计今天下午会3点之前更新完成。暂时需要用电脑客户端的,请到下载页面下载(通用版电脑拨号器),新版客户端上线后官网会发出通知。敬请关注!给大家带来不便,随后会给大家补偿时间!</p>
|
||||
}
|
||||
@if(defaultProduct.Id == 2){
|
||||
@* @if(defaultProduct.Id == 2){
|
||||
<p class="youhuiNew">月卡送1周,双月卡赠送1个月,新开和续费都有赠送<br>(同一个IP账号不限次数,您可对同一账号多次续费都有赠送,每位会员不限账号数量,您可购买多个IP账号都有赠送)</p>
|
||||
} *@
|
||||
@* @if(defaultProduct.Id == 6){
|
||||
|
||||
@@ -53,5 +53,17 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="sitem" style="border: 1px solid red;">
|
||||
<div class="smodel">
|
||||
<div class="softName" style="width:200px;text-align:center;height:50px;">
|
||||
通用版
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<a href="http://wuxinxikehuduan.image.qiangzipptp.top/%E9%80%9A%E7%94%A8%E5%8A%A8%E6%80%81IP%E7%99%BB%E5%BD%95%E5%99%A8.rar"> <button type="button" class="btn btn-sdefault" style="width: auto;">通用版电脑拨号器</button></a>
|
||||
</div>
|
||||
<p>免安装,下载后直接打开</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,22 +80,25 @@ namespace Hncore.Pass.Vpn.Service
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var agentid = "admin2";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "45de79a6720756f3b2db463fe09ba029";
|
||||
var apikey = "a77160a26aa0c4f8bb68c85e5e2c73d8";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
|
||||
|
||||
var userid = "zhanghao";
|
||||
|
||||
var url = "/api/raduserCreate?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&userid="+userid+"&username="+account+"&password="+pwd+"&prdid=8&maxonline="+connCount+"&day="+packageKey;
|
||||
var url = "/api/raduserCreate?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&userid="+userid+"&username="+account+"&password="+pwd+"&prdid=1&maxonline="+connCount+"&day="+packageKey;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
Console.WriteLine("=====================================================================================");
|
||||
Console.WriteLine(content);
|
||||
Console.WriteLine("=====================================================================================");
|
||||
var status = jo["errcode"].ToString();
|
||||
|
||||
if (status =="0")
|
||||
@@ -167,9 +170,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var agentid = "admin2";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "45de79a6720756f3b2db463fe09ba029";
|
||||
var apikey = "a77160a26aa0c4f8bb68c85e5e2c73d8";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
|
||||
@@ -244,9 +247,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var agentid = "admin2";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "45de79a6720756f3b2db463fe09ba029";
|
||||
var apikey = "a77160a26aa0c4f8bb68c85e5e2c73d8";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserInfo?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account;
|
||||
@@ -298,9 +301,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var agentid = "admin2";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "45de79a6720756f3b2db463fe09ba029";
|
||||
var apikey = "a77160a26aa0c4f8bb68c85e5e2c73d8";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserChpw?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account+"&newpass="+pwd;
|
||||
@@ -348,9 +351,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var agentid = "admin2";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "45de79a6720756f3b2db463fe09ba029";
|
||||
var apikey = "a77160a26aa0c4f8bb68c85e5e2c73d8";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserAcct?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account;
|
||||
@@ -404,9 +407,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var agentid = "admin2";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "45de79a6720756f3b2db463fe09ba029";
|
||||
var apikey = "a77160a26aa0c4f8bb68c85e5e2c73d8";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
JObject userinfo = (JObject)JsonConvert.DeserializeObject(id);
|
||||
@@ -448,10 +451,10 @@ namespace Hncore.Pass.Vpn.Service
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var agentid = "admin2";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
|
||||
var apikey = "45de79a6720756f3b2db463fe09ba029";
|
||||
var apikey = "a77160a26aa0c4f8bb68c85e5e2c73d8";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserExist?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account;
|
||||
@@ -460,6 +463,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
Console.WriteLine("=====================================================================================");
|
||||
Console.WriteLine(content);
|
||||
Console.WriteLine("=====================================================================================");
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["errcode"].ToString();
|
||||
|
||||
|
||||
479
Services/Hncore.Pass.Vpn/Service/AgentClient12Service.cs
Normal file
479
Services/Hncore.Pass.Vpn/Service/AgentClient12Service.cs
Normal file
@@ -0,0 +1,479 @@
|
||||
using AngleSharp.Html.Parser;
|
||||
using Hncore.Infrastructure.Common;
|
||||
using Hncore.Infrastructure.Extension;
|
||||
using Hncore.Infrastructure.Serializer;
|
||||
using Hncore.Infrastructure.WebApi;
|
||||
using Hncore.Pass.Vpn.Model;
|
||||
using Hncore.Pass.Vpn.Request.Product;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
namespace Hncore.Pass.Vpn.Service
|
||||
{
|
||||
public class AgentClient12Service:AgentClientBaseService
|
||||
{
|
||||
string LoginUrl { get; set; } = "api/login";
|
||||
string LoginCodeUrl { get; set; } = "main/imgcode.html";
|
||||
string RefrushTokenUrl { get; set; } = "agent/index.html";
|
||||
string SingleAddUrl { get; set; } = "api/number";
|
||||
string SingleReAddUrl { get; set; } = "api/number/renew";
|
||||
string MuiltAddUrl { get; set; } = "agent/memberMuiltAdd.html";
|
||||
string RefundUrl { get; set; } = "api/number/refund";
|
||||
string UpdateUrl = "api/number/";//agent/memberUpdate/id/1155709.html
|
||||
string OnlineUrl { get; set; } = "api/numberLine/";
|
||||
string KIllUrl { get; set; } = "api/numberOffline";
|
||||
string searchAccountUrl = "api/numberSingle/";
|
||||
string searchTestAccountUrl = "api/numberSingle/";
|
||||
string DeleteUrl { get; set; } = "api/number/refund";//1160862.html";
|
||||
IHttpClientFactory m_HttpClientFactory;
|
||||
public AgentClient12Service(IHttpClientFactory httpClientFactory):base(httpClientFactory)
|
||||
{
|
||||
m_HttpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public override async Task<int> RefrushStatus()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
public override async Task<(byte[], string)> GetCode()
|
||||
{
|
||||
var client = CreateHttpClient(false);
|
||||
if (this.LoginUrl.NotHas()) return (null, "");
|
||||
var getResp = await client.GetAsync(this.LoginUrl);
|
||||
var cookie = this.GetCookie(getResp, "PHPSESSID");
|
||||
if (cookie.Has())
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("Cookie", cookie);
|
||||
var ret = await client.GetByteArrayAsync(this.LoginCodeUrl + "?t=" + DateTime.Now.Millisecond);
|
||||
return (ret, cookie);
|
||||
}
|
||||
return (null, "");
|
||||
}
|
||||
public override async Task<ApiResult> Login(AgentLoginRequest request)
|
||||
{
|
||||
return new ApiResult(request.Key);
|
||||
}
|
||||
public override bool CheckAccount(int productId,List<string> accounts)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新开
|
||||
/// </summary>
|
||||
/// <param name="packageId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <param name="pwd"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult> NewAccount(string packageKey, string account, string pwd, int connCount = 1, int accountType = 1, int payCount = 1)
|
||||
{
|
||||
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "a478ad5aa3079bbbef3cd45e2d55d61e";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
|
||||
|
||||
var userid = "kh";
|
||||
|
||||
var url = "/api/raduserCreate?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&userid="+userid+"&username="+account+"&password="+pwd+"&prdid=1&maxonline="+connCount+"&day="+packageKey;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
Console.WriteLine("=====================================================================================");
|
||||
Console.WriteLine(content);
|
||||
Console.WriteLine("=====================================================================================");
|
||||
var status = jo["errcode"].ToString();
|
||||
|
||||
if (status =="0")
|
||||
{
|
||||
return new ApiResult(ResultCode.C_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新开
|
||||
/// </summary>
|
||||
/// <param name="packageId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <param name="pwd"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult> NewMuiltAccount(string packageKey, string account, string pwd, int connCount = 1, int accountType = 1,int startNum=0, int endNum=1 )
|
||||
{
|
||||
var client = CreateHttpClient();
|
||||
var map = new Dictionary<string, string>(){
|
||||
{"group","single" },
|
||||
{"number",account },
|
||||
{"password",pwd },
|
||||
{"connect",connCount.ToString()},
|
||||
{"interval","1"},
|
||||
{"type",packageKey},
|
||||
{"body","api"},
|
||||
{"mobile","13073735878"}
|
||||
};
|
||||
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();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["status"].ToString();
|
||||
if (status =="400")
|
||||
{
|
||||
return new ApiResult(ResultCode.C_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Error(title, content);
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(title, ex.Message);
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 续费
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <param name="pwd"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult> NewReAccount(string packageKey, string account, int connCount, int payCount = 1)
|
||||
{
|
||||
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "a478ad5aa3079bbbef3cd45e2d55d61e";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
|
||||
|
||||
var url = "/api/raduserRenew?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account+"&day="+packageKey;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
Console.WriteLine("==============================================================");
|
||||
Console.WriteLine(content);
|
||||
Console.WriteLine("==============================================================");
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["errcode"].ToString();
|
||||
|
||||
if (status =="0")
|
||||
{
|
||||
return new ApiResult(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "续费失败");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除账号
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> DeleteAccount(string account)
|
||||
{
|
||||
var client = CreateHttpClient();
|
||||
var infoRet = await this.GetAccountInfo(account, true);
|
||||
if (infoRet.Code != ResultCode.C_SUCCESS)
|
||||
return false;
|
||||
|
||||
var title = GetOpTitle("DeleteAccount", account);
|
||||
LogHelper.Info(title, account);
|
||||
try
|
||||
{
|
||||
var delete = this.DeleteUrl + infoRet.Data.Id + ".html";
|
||||
var resp = await client.GetAsync(delete);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
if (content.Has() && content.IndexOf("alert(\"删除成功\")") != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Error(title, content);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(title, ex.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到账号信息
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult<OriginAccountModel>> GetAccountInfo(string account,bool isTest=false)
|
||||
{
|
||||
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "a478ad5aa3079bbbef3cd45e2d55d61e";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserInfo?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["errcode"].ToString();
|
||||
var data = jo["data"];
|
||||
if (status =="0")
|
||||
{
|
||||
var trData = new OriginAccountModel
|
||||
{
|
||||
Id = "",
|
||||
Account = data["username"].ToString(),
|
||||
Pwd = data["password"].ToString(),
|
||||
AccountType = "",
|
||||
Package = "",
|
||||
ConnectCount = "",
|
||||
RegistTime = data["createtime"].ToString(),
|
||||
EndTime = data["expiretime"].ToString(),
|
||||
RestTime = "",
|
||||
Amount = "",
|
||||
Remark = "",
|
||||
};
|
||||
return new ApiResult<OriginAccountModel>(trData);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ApiResult<OriginAccountModel>(ResultCode.C_INVALID_ERROR, "没有查询到信息");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改账号密码
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <param name="pwd"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> UpdateAccountPwd(string account, string pwd)
|
||||
{
|
||||
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "a478ad5aa3079bbbef3cd45e2d55d61e";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserChpw?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account+"&newpass="+pwd;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["errcode"].ToString();
|
||||
if (status =="0")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 退款
|
||||
/// </summary>
|
||||
/// <param name="packageId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult> Refund(string account, string packageKey, int days)
|
||||
{
|
||||
|
||||
|
||||
|
||||
return new ApiResult(1);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否在线
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult<List<OriginAccountOnlineModel>>> OnLine(string account)
|
||||
{
|
||||
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "a478ad5aa3079bbbef3cd45e2d55d61e";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserAcct?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["errcode"].ToString();
|
||||
var retData = new List<OriginAccountOnlineModel>();
|
||||
if (status =="0")
|
||||
{
|
||||
foreach (var tr in jo["data"])
|
||||
{
|
||||
JObject jsondata = (JObject)JsonConvert.DeserializeObject(tr.ToJson());
|
||||
|
||||
var trData = new OriginAccountOnlineModel
|
||||
{
|
||||
Account = account,
|
||||
ServerIP = jsondata["serverip"].ToString(),
|
||||
LoginTime = jsondata["starttime"].ToString(),
|
||||
OnlineTime = "",
|
||||
LoginIP = jsondata["framedip"].ToString(),
|
||||
UpStream = "",
|
||||
DownStream = "",
|
||||
Id= "{account:\""+account+"\",radacctid:\""+jsondata["radacctid"].ToString()+"\"}",
|
||||
|
||||
};
|
||||
|
||||
retData.Add(trData);
|
||||
}
|
||||
return new ApiResult<List<OriginAccountOnlineModel>>(retData);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ApiResult<List<OriginAccountOnlineModel>>(ResultCode.C_INVALID_ERROR, "查询失败");
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 踢号
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> KillOut( string id)
|
||||
{
|
||||
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "a478ad5aa3079bbbef3cd45e2d55d61e";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
JObject userinfo = (JObject)JsonConvert.DeserializeObject(id);
|
||||
|
||||
var url = "/api/raduserDisconnect?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+userinfo["account"]+"&radacctid="+userinfo["radacctid"];
|
||||
|
||||
var client = CreateHttpClient();
|
||||
var title = GetOpTitle("KillOut", id);
|
||||
var info = "";
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["errcode"].ToString();
|
||||
if (status =="0")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error(title, ex.Message + "-->info:" + info);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在
|
||||
/// </summary>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> Exist(string account)
|
||||
{
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
|
||||
var apikey = "a478ad5aa3079bbbef3cd45e2d55d61e";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserExist?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
Console.WriteLine("=====================================================================================");
|
||||
Console.WriteLine(content);
|
||||
Console.WriteLine("=====================================================================================");
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["errcode"].ToString();
|
||||
|
||||
if (status =="0")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,8 @@ namespace Hncore.Pass.Vpn.Service
|
||||
agent = new AgentClient10Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
if (product.GroupNO == "g11")
|
||||
agent = new AgentClient11Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
if (product.GroupNO == "g12")
|
||||
agent = new AgentClient12Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
agent.Product = product;
|
||||
return agent;
|
||||
}
|
||||
|
||||
@@ -312,10 +312,11 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
order.Accounts = request.Account;
|
||||
}
|
||||
|
||||
|
||||
if (packageEntity.Name =="测试卡" && (order.AccountCount !=1 || order.ConnectCount != 1)){
|
||||
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "如果再非法操作,juip官网将对您进行制裁,冻结您的账号");
|
||||
}
|
||||
if (userEntity.Id != 18157){
|
||||
if (packageEntity.Name =="测试卡" && (order.AccountCount !=1 || order.ConnectCount != 1) ){
|
||||
return new ApiResult<ProductOrderEntity>(ResultCode.C_INVALID_ERROR, "如果再非法操作,juip官网将对您进行制裁,冻结您的账号");
|
||||
}
|
||||
}
|
||||
|
||||
//双月卡活动
|
||||
// foreach (var account in order.Accounts.Split(",").ToList())
|
||||
|
||||
Reference in New Issue
Block a user