@@ -40,8 +79,8 @@
account = getQueryVariable('account'),
pass = getQueryVariable('password');
- if(product_id != 13) {
- alert('目前仅支持极客产品!');
+ if(product_id != 13&&product_id != 19) {
+ alert('目前仅支持极客、火狐产品!');
window.location.href = "/User/MyAccounts";
}
@@ -61,53 +100,111 @@
var that = this;
this.assign_account = account;
this.assign_pass = pass;
- $.ajax({
- type: 'GET',
- url: 'http://php-api.juip.com/product/AccountAddress/index?user='+account+'&password='+pass,
- dataType: "json",
- contentType: "application/json",
- success: function (res) {
- console.log(res)
- that.assign_add_list = res;
- //if (res.Code == 10000) {
- // that.onLineData = res.Data;
- // for (var i = 0; i < that.onLineData.length; i++) {
- // that.onLineData[i].ProductId = productId;
- // }
- //}
- }
- });
+ if(product_id == 13){
+ $("#jike").show();
+ $("#huohu").hide();
+ $.ajax({
+ type: 'GET',
+ url: 'http://php-api.juip.com/product/AccountAddress/index?user='+account+'&password='+pass,
+ dataType: "json",
+ contentType: "application/json",
+ success: function (res) {
+ that.assign_add_list = res;
+ //if (res.Code == 10000) {
+ // that.onLineData = res.Data;
+ // for (var i = 0; i < that.onLineData.length; i++) {
+ // that.onLineData[i].ProductId = productId;
+ // }
+ //}
+ }
+ });
+ }
+ if(product_id == 19){
+ $("#huohu").show();
+ $("#jike").hide();
+ $.ajax({
+ type: 'GET',
+ url: 'http://php-api.juip.com/product/AccountAddress/getList?user='+account+'&password='+pass,
+ dataType: "json",
+ contentType: "application/json",
+ success: function (res) {
+ $("#huohu").html('
统一服务器地址:1.hhip.vip
');
+ $("#huohu").append(res.ipmodel);
+ $("#huohu").append("
");
+ $("#huohu").append(res.city);
+
+ }
+ });
+ }
},
selectAddAssign() {
- if(this.assign_list.length>20||this.assign_list.length==0){
- alert('最多选择20个,至少选择一个!');
- return;
- }
- let data = {
- list:this.assign_list,
- account:this.assign_account,
- password:this.assign_pass,
- }
- $.ajax({
- type: 'POST',
- url: 'http://php-api.juip.com/product/AccountAddress/select',
- dataType: "json",
- data:JSON.stringify(data),
- contentType: "application/json",
- success: function (res) {
- if(res.code == 1){
- alert('选择成功');
- } else {
- alert('选择失败');
- }
- //if (res.Code == 10000) {
- // that.onLineData = res.Data;
- // for (var i = 0; i < that.onLineData.length; i++) {
- // that.onLineData[i].ProductId = productId;
- // }
- //}
+ if(product_id == 13){
+ if(this.assign_list.length>20||this.assign_list.length==0){
+ alert('最多选择20个,至少选择一个!');
+ return;
}
- });
+ let data = {
+ list:this.assign_list,
+ account:this.assign_account,
+ password:this.assign_pass,
+ }
+ $.ajax({
+ type: 'POST',
+ url: 'http://php-api.juip.com/product/AccountAddress/select',
+ dataType: "json",
+ data:JSON.stringify(data),
+ contentType: "application/json",
+ success: function (res) {
+ if(res.code == 1){
+ alert('选择成功');
+ } else {
+ alert('选择失败');
+ }
+ //if (res.Code == 10000) {
+ // that.onLineData = res.Data;
+ // for (var i = 0; i < that.onLineData.length; i++) {
+ // that.onLineData[i].ProductId = productId;
+ // }
+ //}
+ }
+ });
+ }
+ if(product_id == 19){
+ let address_checked = [];
+ $("input[name='citys[]']:checked").each(function(i){
+ address_checked.push($(this).val());
+ });
+ let ipmode = $("select[name='ipmode']").val();
+ console.log(address_checked)
+ console.log(ipmode)
+
+ let data = {
+ list:address_checked,
+ account:this.assign_account,
+ password:this.assign_pass,
+ ipmode:ipmode,
+ }
+ $.ajax({
+ type: 'POST',
+ url: 'http://php-api.juip.com/product/AccountAddress/setAddress',
+ dataType: "json",
+ data:JSON.stringify(data),
+ contentType: "application/json",
+ success: function (res) {
+ if(res.code == 1){
+ alert('选择成功');
+ } else {
+ alert('选择失败');
+ }
+ //if (res.Code == 10000) {
+ // that.onLineData = res.Data;
+ // for (var i = 0; i < that.onLineData.length; i++) {
+ // that.onLineData[i].ProductId = productId;
+ // }
+ //}
+ }
+ });
+ }
},
}
})
diff --git a/Host/Views.Mobile/User/Index.cshtml b/Host/Views.Mobile/User/Index.cshtml
index dfe4944..05504fd 100644
--- a/Host/Views.Mobile/User/Index.cshtml
+++ b/Host/Views.Mobile/User/Index.cshtml
@@ -27,4 +27,34 @@
$("#coupon_num").text(res.Data.length);
}
})
+
+ function getQueryString(name) {
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+ var r = window.location.search.substr(1).match(reg);
+ if (r != null) return unescape(r[2]);
+ return null;
+ }
+
+ var is_realname = getQueryString('realname');
+
+ if(is_realname){
+ let data = {
+ cookie:document.cookie
+ }
+ $.ajax({
+ type: 'POST',
+ url: 'http://php-api.juip.com/api/test/aliGetResult',
+ dataType: "json",
+ contentType: "application/json",
+ data: JSON.stringify(data),
+ beforeSend: function(xhr) {
+ xhr.withCredentials = true;
+ },
+ crossDomain: true,
+ success: function (res) {
+ }
+ });
+ }
+
+
diff --git a/Host/Views.Mobile/User/MyAccounts.cshtml b/Host/Views.Mobile/User/MyAccounts.cshtml
index a46c128..329ba1b 100644
--- a/Host/Views.Mobile/User/MyAccounts.cshtml
+++ b/Host/Views.Mobile/User/MyAccounts.cshtml
@@ -99,8 +99,8 @@
-
-
+
+
diff --git a/Host/Views/LineList/Index.cshtml b/Host/Views/LineList/Index.cshtml
index 4a8e629..1e5ca84 100644
--- a/Host/Views/LineList/Index.cshtml
+++ b/Host/Views/LineList/Index.cshtml
@@ -94,7 +94,8 @@
| 产品 |
城市 |
- 运营商 |
+ 剩余拨数 |
+ 运营商 |
服务器域名 |
IP量 |
实时带宽 |
@@ -228,6 +229,11 @@
this.search_field = '蘑菇IP';
this.sstp = '4430';
break;
+ case 19:
+ this.l2tp = '123';
+ this.search_field = '火狐IP';
+ this.sstp = '1500';
+ break;
}
$.ajax({
type: 'GET',
@@ -344,6 +350,9 @@
case 18:
self.location.href='http://php-api.juip.com/script/linedata/data/download/mogu.csv';
break;
+ case 19:
+ self.location.href='http://php-api.juip.com/script/linedata/data/download/huohu.csv';
+ break;
}
}
}
diff --git a/Host/Views/Product/Index.cshtml b/Host/Views/Product/Index.cshtml
index 338701d..e648dbf 100644
--- a/Host/Views/Product/Index.cshtml
+++ b/Host/Views/Product/Index.cshtml
@@ -517,7 +517,7 @@
else if(item.Product.Id == 6||item.Product.Id == 2||item.Product.Id == 4 ||item.Product.Id == 14||item.Product.Id == 8) {
@item.Product.Name 抄底价
}
- else if(item.Product.Id == 18|| item.Product.Id == 5) {
+ else if(item.Product.Id == 18|| item.Product.Id == 5|| item.Product.Id == 19) {
新@item.Product.Name 抄底价
}
else if(item.Product.Id == 17) {
@@ -606,6 +606,9 @@
@* @if(item.Product.Id == 8){
月卡送10天,双月卡赠送1个月,活动截止时间2021年3月31日
(同一个IP账号不限次数,您可对同一账号多次续费都有赠送,每位会员不限账号数量,您可购买多个IP账号都有赠送))
} *@
+ @if(item.Product.Id == 19){
+ 本产品为独享,每个账号对应一个宽带拨号,永不超载,保证了网速及稳定性。
使用时只需设置这个唯一的服务器:1.hhip.vip,在账号列表中点击切换地区即可任意组合自己需要的地区。本产品灵活便捷,欢迎选购!
+ }
@*—@item.Product.Name—
*@
diff --git a/Host/Views/Product/ReBuyIndex.cshtml b/Host/Views/Product/ReBuyIndex.cshtml
index 5cedb8c..3fcfbf4 100644
--- a/Host/Views/Product/ReBuyIndex.cshtml
+++ b/Host/Views/Product/ReBuyIndex.cshtml
@@ -442,6 +442,9 @@
@* @if(defaultProduct.Id == 8){
月卡送10天,双月卡赠送1个月,活动截止时间2021年3月31日
(同一个IP账号不限次数,您可对同一账号多次续费都有赠送,每位会员不限账号数量,您可购买多个IP账号都有赠送))
} *@
+ @if(defaultProduct.Id == 19){
+
本产品为独享,每个账号对应一个宽带拨号,永不超载,保证了网速及稳定性。
使用时只需设置这个唯一的服务器:1.hhip.vip,在账号列表中点击切换地区即可任意组合自己需要的地区。本产品灵活便捷,欢迎选购!
+ }
diff --git a/Host/Views/User/MyAccounts.cshtml b/Host/Views/User/MyAccounts.cshtml
index a512ff4..1024358 100644
--- a/Host/Views/User/MyAccounts.cshtml
+++ b/Host/Views/User/MyAccounts.cshtml
@@ -51,6 +51,18 @@
padding: 30px;
display: none;
}
+ .citylabel {
+ font-weight: normal;
+ width: 160px;
+ height: 35px;
+ padding-left: 5px;
+ padding-top: 5px;
+ text-align: left;
+ border: solid 1px #ccc;
+ }
+ .province{
+ margin-bottom: 10px;
+ }
.online {
position: fixed;
@@ -250,20 +262,26 @@
@* 指定地区 *@
-
-
最多选择20条线路 标红为线路正在维护中
-

-
-
-
-
-
-
+
+
+
最多选择20条线路 标红为线路正在维护中
+

+
+
+
+
+
+
+
+
+ 请稍后,加载中...
+
+
@@ -382,7 +400,7 @@
@(item.Status==AccountStatus.Refund?"已退货": item.RestTime) |
@*
查看 | *@
查看 |
-
地区列表 |
+
切换地区 |
查看 |
下载 |
@@ -452,11 +470,11 @@
mutilAuthLoading: false,
oneAuthLoading: false,
showOnline: false,
- showAddress: false,
assign_add_list:[],
assign_list:[],
assign_account:'',
assign_pass:'',
+ productId:'',
searchModel: {
ExpiredDay:-1,
ProductId:@this.Context.Request.GetInt("ProductId"),
@@ -643,64 +661,125 @@
});
},
assign_address(productId, account,pass) {
- if(productId != 13){
- alert('目前仅支持极客产品!');
+ if(productId != 13 && productId != 19){
+ alert('目前仅支持极客、火狐产品!');
return;
}
- this.showAddress = true
- var that = this;
+ $("#showAddress").show();
+ var that = this;
+
this.assign_account = account;
- this.assign_pass = pass;
- $.ajax({
- type: 'GET',
- url: 'http://php-api.juip.com/product/AccountAddress/index?user='+account+'&password='+pass,
- dataType: "json",
- contentType: "application/json",
- success: function (res) {
- that.assign_add_list = res;
- //if (res.Code == 10000) {
- // that.onLineData = res.Data;
- // for (var i = 0; i < that.onLineData.length; i++) {
- // that.onLineData[i].ProductId = productId;
- // }
- //}
- }
- });
+ this.assign_pass = pass;
+ this.productId = productId;
+ if(productId == 13){
+ $("#jike").show();
+ $("#huohu").hide();
+ $.ajax({
+ type: 'GET',
+ url: 'http://php-api.juip.com/product/AccountAddress/index?user='+account+'&password='+pass,
+ dataType: "json",
+ contentType: "application/json",
+ success: function (res) {
+ that.assign_add_list = res;
+ //if (res.Code == 10000) {
+ // that.onLineData = res.Data;
+ // for (var i = 0; i < that.onLineData.length; i++) {
+ // that.onLineData[i].ProductId = productId;
+ // }
+ //}
+ }
+ });
+ }
+ if(productId == 19){
+ $("#huohu").show();
+ $("#jike").hide();
+ $.ajax({
+ type: 'GET',
+ url: 'http://php-api.juip.com/product/AccountAddress/getList?user='+account+'&password='+pass,
+ dataType: "json",
+ contentType: "application/json",
+ success: function (res) {
+ $("#huohu").html('
统一服务器地址:1.hhip.vip
');
+ $("#huohu").append(res.ipmodel);
+ $("#huohu").append("
");
+ $("#huohu").append(res.city);
+
+ }
+ });
+ }
},
selectAddAssign() {
- if(this.assign_list.length>20||this.assign_list.length==0){
- alert('最多选择20个,至少选择一个!');
- return;
- }
- let data = {
- list:this.assign_list,
- account:this.assign_account,
- password:this.assign_pass,
- }
- $.ajax({
- type: 'POST',
- url: 'http://php-api.juip.com/product/AccountAddress/select',
- dataType: "json",
- data:JSON.stringify(data),
- contentType: "application/json",
- success: function (res) {
- if(res.code == 1){
- alert('选择成功');
- } else {
- alert('选择失败');
- }
- //if (res.Code == 10000) {
- // that.onLineData = res.Data;
- // for (var i = 0; i < that.onLineData.length; i++) {
- // that.onLineData[i].ProductId = productId;
- // }
- //}
+ if(this.productId == 19){
+ let address_checked = [];
+ $("input[name='citys[]']:checked").each(function(i){
+ address_checked.push($(this).val());
+ });
+ let ipmode = $("select[name='ipmode']").val();
+ console.log(address_checked)
+ console.log(ipmode)
+
+ let data = {
+ list:address_checked,
+ account:this.assign_account,
+ password:this.assign_pass,
+ ipmode:ipmode,
}
- });
+ $.ajax({
+ type: 'POST',
+ url: 'http://php-api.juip.com/product/AccountAddress/setAddress',
+ dataType: "json",
+ data:JSON.stringify(data),
+ contentType: "application/json",
+ success: function (res) {
+ if(res.code == 1){
+ alert('选择成功');
+ } else {
+ alert('选择失败');
+ }
+ //if (res.Code == 10000) {
+ // that.onLineData = res.Data;
+ // for (var i = 0; i < that.onLineData.length; i++) {
+ // that.onLineData[i].ProductId = productId;
+ // }
+ //}
+ }
+ });
+ }
+ if(this.productId == 13){
+ if(this.assign_list.length>20||this.assign_list.length==0){
+ alert('最多选择20个,至少选择一个!');
+ return;
+ }
+ let data = {
+ list:this.assign_list,
+ account:this.assign_account,
+ password:this.assign_pass,
+ }
+ $.ajax({
+ type: 'POST',
+ url: 'http://php-api.juip.com/product/AccountAddress/select',
+ dataType: "json",
+ data:JSON.stringify(data),
+ contentType: "application/json",
+ success: function (res) {
+ if(res.code == 1){
+ alert('选择成功');
+ } else {
+ alert('选择失败');
+ }
+ //if (res.Code == 10000) {
+ // that.onLineData = res.Data;
+ // for (var i = 0; i < that.onLineData.length; i++) {
+ // that.onLineData[i].ProductId = productId;
+ // }
+ //}
+ }
+ });
+ }
},
closeOnline() {
this.showOnline = false;
- this.showAddress = false;
+ $("#showAddress").hide();
this.onLineData = [];
},
killout: function (item) {
diff --git a/Services/Hncore.Pass.Vpn/Service/AgentClient14Service.cs b/Services/Hncore.Pass.Vpn/Service/AgentClient14Service.cs
new file mode 100644
index 0000000..7d0e8af
--- /dev/null
+++ b/Services/Hncore.Pass.Vpn/Service/AgentClient14Service.cs
@@ -0,0 +1,475 @@
+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 AgentClient14Service: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 AgentClient14Service(IHttpClientFactory httpClientFactory):base(httpClientFactory)
+ {
+ m_HttpClientFactory = httpClientFactory;
+ }
+
+ public override async Task
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 Login(AgentLoginRequest request)
+ {
+ return new ApiResult(request.Key);
+ }
+ public override bool CheckAccount(int productId,List accounts)
+ {
+ return false;
+ }
+
+ ///
+ /// 新开
+ ///
+ ///
+ ///
+ ///
+ ///
+ public override async Task 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 = "b220b83508db57f44e5ce86a7b34cae9";
+ 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=8&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);
+ var status = jo["errcode"].ToString();
+
+ if (status =="0")
+ {
+ return new ApiResult(ResultCode.C_SUCCESS);
+ }
+ else
+ {
+ return new ApiResult(ResultCode.C_INVALID_ERROR, "开户失败");
+ }
+ }
+
+ ///
+ /// 新开
+ ///
+ ///
+ ///
+ ///
+ ///
+ public override async Task 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(){
+ {"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, "开户失败");
+ }
+ }
+
+ ///
+ /// 续费
+ ///
+ ///
+ ///
+ ///
+ ///
+ public override async Task 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 = "b220b83508db57f44e5ce86a7b34cae9";
+ 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();
+ 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, "续费失败");
+ }
+ }
+ ///
+ /// 删除账号
+ ///
+ ///
+ ///
+ ///
+ public override async Task 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;
+ }
+ }
+ ///
+ /// 得到账号信息
+ ///
+ ///
+ ///
+ ///
+ public override async Task> 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 = "b220b83508db57f44e5ce86a7b34cae9";
+ 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(trData);
+ }
+ else
+ {
+ return new ApiResult(ResultCode.C_INVALID_ERROR, "没有查询到信息");
+ }
+
+
+
+ }
+ ///
+ /// 修改账号密码
+ ///
+ ///
+ ///
+ ///
+ ///
+ public override async Task 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 = "b220b83508db57f44e5ce86a7b34cae9";
+ 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;
+ }
+
+ }
+ ///
+ /// 退款
+ ///
+ ///
+ ///
+ ///
+ public override async Task Refund(string account, string packageKey, int days)
+ {
+
+
+
+ return new ApiResult(1);
+
+ }
+ ///
+ /// 是否在线
+ ///
+ ///
+ ///
+ ///
+ public override async Task>> 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 = "b220b83508db57f44e5ce86a7b34cae9";
+ 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();
+ if (status =="0")
+ {
+ if(jo.ContainsKey("data")){
+ 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>(retData);
+ }
+ else
+ {
+ return new ApiResult>(ResultCode.C_INVALID_ERROR, "查询失败");
+ }
+
+ }
+ ///
+ /// 踢号
+ ///
+ ///
+ ///
+ ///
+ public override async Task 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 = "b220b83508db57f44e5ce86a7b34cae9";
+ 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;
+ }
+
+ ///
+ /// 是否存在
+ ///
+ ///
+ ///
+ public override async Task 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 = "b220b83508db57f44e5ce86a7b34cae9";
+ 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;
+ }
+ }
+}
diff --git a/Services/Hncore.Pass.Vpn/Service/AgentService.cs b/Services/Hncore.Pass.Vpn/Service/AgentService.cs
index b300591..393adb4 100644
--- a/Services/Hncore.Pass.Vpn/Service/AgentService.cs
+++ b/Services/Hncore.Pass.Vpn/Service/AgentService.cs
@@ -69,6 +69,8 @@ namespace Hncore.Pass.Vpn.Service
agent = new AgentClient12Service(m_HttpClientFactory) { ClientName = product.GroupNO };
if (product.GroupNO == "g13")
agent = new AgentClient13Service(m_HttpClientFactory) { ClientName = product.GroupNO };
+ if (product.GroupNO == "g14")
+ agent = new AgentClient14Service(m_HttpClientFactory) { ClientName = product.GroupNO };
agent.Product = product;
return agent;
}