yunniu
This commit is contained in:
@@ -114,7 +114,7 @@ namespace Home.Controllers
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
if (m.ProductId == 6||m.ProductId == 5||m.ProductId == 23){
|
||||
m.Title = "9";
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ namespace Home.Controllers
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
if (m.ProductId == 6||m.ProductId == 5||m.ProductId == 23){
|
||||
m.Title = "9";
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Home.Controllers
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
if (m.ProductId == 6||m.ProductId == 5||m.ProductId == 23){
|
||||
m.Title = "9";
|
||||
}
|
||||
if ((m.DayCount == 1||m.DayCount == 2) && m.Id != 1034&&m.Id != 1040 ){
|
||||
@@ -925,7 +925,7 @@ namespace Home.Controllers
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
if (m.ProductId == 6||m.ProductId == 5||m.ProductId == 23){
|
||||
m.Title = "9";
|
||||
}
|
||||
}
|
||||
@@ -963,7 +963,7 @@ namespace Home.Controllers
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
if (m.ProductId == 6||m.ProductId == 5||m.ProductId == 23){
|
||||
m.Title = "9";
|
||||
}
|
||||
var userPrice = userPrices.FirstOrDefault(p => p.PackageId == m.Id);
|
||||
|
||||
@@ -609,7 +609,7 @@ namespace Home.Controllers
|
||||
{
|
||||
var notifyOrder = data.FromJsonTo<TaoBaoNotifyModel>();
|
||||
LogHelper.Info("TaoBao process");
|
||||
if(notifyOrder.Payment == "10.00" && (notifyOrder.SellerNick == "聚ip商城动态ip代理" || notifyOrder.SellerNick == "老鹰动态pptp")){
|
||||
if(notifyOrder.Payment == "10.00" && (notifyOrder.SellerNick == "聚ip商城动态ip代理" || notifyOrder.SellerNick == "老鹰动态pptp")||notifyOrder.SellerNick == "老鹰动态pptp"){
|
||||
return "您好,"+notifyOrder.Payment+"元已充值到充值到您的会员中";
|
||||
}
|
||||
if (notifyOrder == null || notifyOrder.Tid.NotHas())
|
||||
|
||||
@@ -238,10 +238,16 @@
|
||||
this.search_field = '蘑菇IP';
|
||||
this.sstp = '4430';
|
||||
break;
|
||||
case 19:
|
||||
this.l2tp = '123';
|
||||
this.search_field = '火狐独享IP';
|
||||
this.sstp = '1500';
|
||||
case 22:
|
||||
this.l2tp = '888888';
|
||||
this.search_field = '火狐IP';
|
||||
this.sstp = '5908';
|
||||
break;
|
||||
|
||||
case 23:
|
||||
this.l2tp = '888888';
|
||||
this.search_field = '云牛IP';
|
||||
this.sstp = '5908';
|
||||
break;
|
||||
}
|
||||
$.ajax({
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="item">
|
||||
<ul class="nav nav-tabs cpName" role="tablist">
|
||||
<li >
|
||||
<a style="color:#0098fb"><span class="glyphicon glyphicon-arrow-down"></span>全局独享IP<span class="glyphicon glyphicon-arrow-down"></span></a>
|
||||
<a style="color:#0098fb"><span class="glyphicon glyphicon-arrow-down"></span>动态独享IP<span class="glyphicon glyphicon-arrow-down"></span></a>
|
||||
</li>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
@@ -59,7 +59,7 @@
|
||||
}
|
||||
else if(item.Product.Id == 18) {
|
||||
<li role="presentation" class="@(item.Product.Id==defaultProduct.Id?"active":"")">
|
||||
<a href="#@item.Product.Id" role="tab" data-toggle="tab" style="font-size: 25px;"><span class="glyphicon glyphicon-thumbs-up" style="color: #f64e3d;font-weight:bold;padding-right: 5px;">新</span>@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">8折</span></a>
|
||||
<a href="#@item.Product.Id" role="tab" data-toggle="tab" style="font-size: 25px;"><span class="glyphicon glyphicon-thumbs-up" style="color: #f64e3d;font-weight:bold;padding-right: 5px;">送</span>@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">8折</span></a>
|
||||
</li>
|
||||
}
|
||||
else if(item.Product.Id == 1||item.Product.Id == 2||item.Product.Id == 13||item.Product.Id == 17||item.Product.Id == 19) {
|
||||
@@ -72,6 +72,11 @@
|
||||
<a href="#@item.Product.Id" role="tab" data-toggle="tab" style="font-size: 25px;">@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">9折</span></a>
|
||||
</li>
|
||||
}
|
||||
else if(item.Product.Id == 23) {
|
||||
<li role="presentation" class="@(item.Product.Id==defaultProduct.Id?"active":"")">
|
||||
<a href="#@item.Product.Id" role="tab" data-toggle="tab" style="font-size: 25px;">@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">9折</span></a>
|
||||
</li>
|
||||
}
|
||||
else if(item.Product.Id == 14) {
|
||||
<li role="presentation" class="@(item.Product.Id==defaultProduct.Id?"active":"")">
|
||||
<a href="#@item.Product.Id" id="p14" role="tab" data-toggle="tab" style="font-size: 25px;">@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">8折</span></a>
|
||||
@@ -275,67 +280,74 @@
|
||||
//1 安卓、苹果 2 pc
|
||||
var wjgxtype = 1;
|
||||
function wjgxphone() {
|
||||
$("#wjgxgd").removeClass("active");
|
||||
$("#wjgxpt").addClass("active");
|
||||
wjgxtype = 1;
|
||||
for (var i=1060;i<1063;i++){
|
||||
$("#package-"+i).show();
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
for (var i=1063;i<1072;i++){
|
||||
$("#package-"+i).hide();
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
}
|
||||
wjgxphone();
|
||||
|
||||
function wjgxpc() {
|
||||
$("#wjgxgd").removeClass("active");
|
||||
$("#wjgxpt").addClass("active");
|
||||
wjgxtype = 2;
|
||||
for (var i=1060;i<1066;i++){
|
||||
$("#package-"+i).hide();
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
for (var i=1069;i<1072;i++){
|
||||
$("#package-"+i).hide();
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
for (var i=1066;i<1069;i++){
|
||||
$("#package-"+i).show();
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
}
|
||||
function wjgxpt() {
|
||||
$("#wjgxgd").removeClass("active");
|
||||
$("#wjgxpt").addClass("active");
|
||||
if (wjgxtype == 1) {
|
||||
for (var i=1060;i<1063;i++){
|
||||
$("#package-"+i).show();
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
for (var i=1063;i<1072;i++){
|
||||
$("#package-"+i).hide();
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
} else if (wjgxtype == 2) {
|
||||
for (var i=1060;i<1063;i++){
|
||||
$("#package-"+i).hide();
|
||||
for (var i=1060;i<1066;i++){
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
for (var i=1063;i<1066;i++){
|
||||
$("#package-"+i).show();
|
||||
for (var i=1066;i<1069;i++){
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
|
||||
for (var i=1067;i<1072;i++){
|
||||
$("#package-"+i).hide();
|
||||
for (var i=1069;i<1072;i++){
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
function wjgxgj() {
|
||||
$("#wjgxgd").addClass("active");
|
||||
$("#wjgxpt").removeClass("active");
|
||||
if (wjgxtype == 1) {
|
||||
for (var i=1060;i<1063;i++){
|
||||
$("#package-"+i).hide();
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
for (var i=1063;i<1066;i++){
|
||||
$("#package-"+i).show();
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
|
||||
for (var i=1066;i<1072;i++){
|
||||
$("#package-"+i).hide();
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
} else if (wjgxtype == 2) {
|
||||
for (var i=1060;i<1069;i++){
|
||||
$("#package-"+i).hide();
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
for (var i=1069;i<1072;i++){
|
||||
$("#package-"+i).show();
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
<p><a href="http://wuxinxikehuduan.image.qiangzipptp.top/%E8%AE%AF%E8%BF%9EIP%E5%AE%89%E5%8D%93%E7%AB%AF-%E4%BB%A3%E7%90%86%E7%89%88.apk"> <button type="button" class="btnBlue">讯连IP-安卓端</button></a></p>
|
||||
<p><a href="http://wuxinxikehuduan.image.qiangzipptp.top/%E5%BC%BA%E5%AD%90IP%E7%94%B5%E8%84%91%E7%AB%AF-%E4%BB%A3%E7%90%86%E7%89%88.rar"> <button type="button" class="btnBlue">强子IP-电脑版</button></a></p>
|
||||
<p><a href="http://wuxinxikehuduan.image.qiangzipptp.top/%E5%BC%BA%E5%AD%90IP%E5%AE%89%E5%8D%93%E7%AB%AF-%E4%BB%A3%E7%90%86%E7%89%88.apk"> <button type="button" class="btnBlue">强子IP-安卓端</button></a></p>
|
||||
<p><a href="http://wuxinxikehuduan.image.qiangzipptp.top/%E7%81%AB%E7%8B%90IP%E5%AE%89%E5%8D%93%E7%AB%AF-%E4%BB%A3%E7%90%86%E7%89%88.apk"> <button type="button" class="btnBlue">火狐IP-安卓端</button></a></p>
|
||||
<p><a href="http://app.cn98.net:8000/huohupubnet.apk"> <button type="button" class="btnBlue">火狐IP-安卓端</button></a></p>
|
||||
<p><a href="http://app.ipsoft168.com:8000/yunniupubdtip.apk"> <button type="button" class="btnBlue">云牛IP-安卓端</button></a></p>
|
||||
<p><a href="http://wuxinxikehuduan.image.qiangzipptp.top/%E6%98%9F%E6%98%9FIP%E7%94%B5%E8%84%91%E7%AB%AF-4.10%E4%BB%A3%E7%90%86%E7%89%88.rar"> <button type="button" class="btnBlue">星星IP-电脑端</button></a></p><br>
|
||||
<p><a href="http://wuxinxikehuduan.image.qiangzipptp.top/%E8%98%91%E8%8F%87IP%E7%94%B5%E8%84%91%E5%AE%A2%E6%88%B7%E7%AB%AF-%E4%BB%A3%E7%90%86%E7%89%88.exe"> <button type="button" class="btnBlue">蘑菇IP-电脑端</button></a></p><br>
|
||||
</div>
|
||||
|
||||
@@ -237,6 +237,12 @@
|
||||
this.search_field = '火狐IP';
|
||||
this.sstp = '5908';
|
||||
break;
|
||||
|
||||
case 23:
|
||||
this.l2tp = '888888';
|
||||
this.search_field = '云牛IP';
|
||||
this.sstp = '5908';
|
||||
break;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
|
||||
@@ -360,11 +360,11 @@
|
||||
<div class="left" style="width: 175px;margin-top:calc(10vh);">
|
||||
<div class="nav-back" style="width: 175px;"></div>
|
||||
<div class="nav" style="width:175px;">
|
||||
<div style="background-color: #ccc;color:#0098fb" disabled="disabled"><span class="glyphicon glyphicon-arrow-down"></span>全局独享IP<span class="glyphicon glyphicon-arrow-down"></span></div>
|
||||
<div style="background-color: #ccc;color:#0098fb" disabled="disabled"><span class="glyphicon glyphicon-arrow-down"></span>动态独享IP<span class="glyphicon glyphicon-arrow-down"></span></div>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
if(item.Product.Id == 18) {
|
||||
<div class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id"><span class="glyphicon glyphicon-thumbs-up" style="color: #f64e3d;font-weight:bold;padding-right: 5px;">新</span>@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">8折</span></div>
|
||||
<div class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id"><span class="glyphicon glyphicon-thumbs-up" style="color: #f64e3d;font-weight:bold;padding-right: 5px;">送</span>@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">8折</span></div>
|
||||
}
|
||||
else if(item.Product.Id == 6) {
|
||||
<div class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id"><span class="glyphicon glyphicon-thumbs-up" style="color: #f64e3d;font-weight:bold;padding-right: 5px;"> </span>@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">9折</span></div>
|
||||
@@ -375,6 +375,9 @@
|
||||
else if(item.Product.Id == 5) {
|
||||
<div class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id">@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">9折</span></div>
|
||||
}
|
||||
else if(item.Product.Id == 23) {
|
||||
<div class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id">@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">9折</span></div>
|
||||
}
|
||||
else if(item.Product.Id == 14) {
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn dropdown-toggle" style="width: 99%;height:100%;background:white;padding:0;" id="dropdownMenu1" data-toggle="dropdown"><div style="font-size: 18px;" class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id">@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">8折</span></div>
|
||||
@@ -411,6 +414,10 @@
|
||||
<div style="background-color: #ccc;color:#0098fb" disabled="disabled"><span class="glyphicon glyphicon-arrow-down"></span>静态IP<span class="glyphicon glyphicon-arrow-down"></span></div>
|
||||
<div class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id"><span style="color: #f64e3d;font-weight:bold;padding-right: 5px;">新</span>@item.Product.Name</div>
|
||||
|
||||
}
|
||||
else if(item.Product.Id == 23) {
|
||||
<div class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id"><span style="color: #f64e3d;font-weight:bold;padding-right: 5px;">新</span>@item.Product.Name</div>
|
||||
|
||||
}
|
||||
|
||||
else if(item.Product.Id == 21) {
|
||||
@@ -1082,14 +1089,14 @@
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
} else if (wjgxtype == 2) {
|
||||
for (var i=1060;i<1063;i++){
|
||||
for (var i=1060;i<1066;i++){
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
for (var i=1063;i<1066;i++){
|
||||
for (var i=1066;i<1069;i++){
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
|
||||
for (var i=1067;i<1072;i++){
|
||||
for (var i=1069;i<1072;i++){
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,6 +146,14 @@
|
||||
<div class="item" style="margin-bottom: 5px;">
|
||||
<a href="http://app.cn98.net:8000/huohupubnet.apk"> <button type="button" class="btn btn-sdefault" style="width: auto;">火狐IP-安卓端</button></a>
|
||||
</div>
|
||||
|
||||
<div class="item" style="margin-bottom: 5px;">
|
||||
<a href="http://client.ipsoft365.com:8000/soft/yunniupubdtip.exe"> <button type="button" class="btn btn-sdefault" style="width: auto;">云牛IP-电脑端</button></a>
|
||||
</div>
|
||||
|
||||
<div class="item" style="margin-bottom: 5px;">
|
||||
<a href="http://app.ipsoft168.com:8000/yunniupubdtip.apk"> <button type="button" class="btn btn-sdefault" style="width: auto;">云牛IP-安卓端</button></a>
|
||||
</div>
|
||||
<p>免安装,下载后直接打开</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -682,7 +682,7 @@
|
||||
}
|
||||
},
|
||||
checkOneAccount() {
|
||||
if (productId == 20) {
|
||||
if (productId == 20||productId == 21) {
|
||||
if (this.OneBuyModel.Account.length > 10 || this.OneBuyModel.Account.length < 7 || !this.hasNumAndChar(this.OneBuyModel.Account)) {
|
||||
alert("此产品账号必须大于6位");
|
||||
this.OneChecker.AccountOk = false;
|
||||
@@ -708,7 +708,7 @@
|
||||
return true;
|
||||
},
|
||||
checkMoreAccount() {
|
||||
if (productId == 20) {
|
||||
if (productId == 20||productId == 21) {
|
||||
if (this.MoreBuyModel.Account.length < 6 || this.MoreBuyModel.Account.length > 8 || !this.hasNumAndChar(this.MoreBuyModel.Account)) {
|
||||
alert("此产品账号必须大于6位");
|
||||
this.MoreChecker.AccountOk = false;
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
{"userpass",pwd},
|
||||
{"qq","123456789"},
|
||||
{"time",time},
|
||||
{"num","1"},
|
||||
{"num",connCount.ToString()},
|
||||
{"type",type},
|
||||
{"ip",speed},
|
||||
{"remark","api开通"},
|
||||
|
||||
427
Services/Hncore.Pass.Vpn/Service/AgentClient18Service.cs
Normal file
427
Services/Hncore.Pass.Vpn/Service/AgentClient18Service.cs
Normal file
@@ -0,0 +1,427 @@
|
||||
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 AgentClient18Service: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 AgentClient18Service(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;
|
||||
}
|
||||
|
||||
public override async Task<ApiResult> NewAccount(string packageKey, string account, string pwd, int connCount = 1, int accountType = 1, int payCount = 1)
|
||||
{
|
||||
|
||||
var url = "?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf&type=adduser&user="+account+"&pass="+pwd+"&serverid="+packageKey+"&logincount="+connCount.ToString()+"&idname=万勇强&idcard=410325199407079912";
|
||||
|
||||
if (packageKey == "test") {
|
||||
url = "?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf&type=addtestuser&user="+account+"&password="+pwd+"&idname=万勇强&idcard=410325199407079912";
|
||||
}
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = "";
|
||||
using (var sr = new StreamReader(resp.Content.ReadAsStreamAsync().Result, Encoding.GetEncoding("iso-8859-1")))
|
||||
{
|
||||
content = sr.ReadToEnd();
|
||||
}
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
if (status =="1")
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
var url = "?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf&type=buy&user="+account+"&serverid="+packageKey;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = "";
|
||||
using (var sr = new StreamReader(resp.Content.ReadAsStreamAsync().Result, Encoding.GetEncoding("iso-8859-1")))
|
||||
{
|
||||
content = sr.ReadToEnd();
|
||||
}
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
if (status =="1")
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
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/raduserRefund?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 true;
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
var url = "?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf&type=getuserinfo&user="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = "";
|
||||
using (var sr = new StreamReader(resp.Content.ReadAsStreamAsync().Result, Encoding.GetEncoding("iso-8859-1")))
|
||||
{
|
||||
content = sr.ReadToEnd();
|
||||
}
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
if (status =="1")
|
||||
{
|
||||
var trData = new OriginAccountModel
|
||||
{
|
||||
Id = "",
|
||||
Account = account,
|
||||
Pwd = jo["password"].ToString(),
|
||||
AccountType = jo["pause"].ToString(),
|
||||
Package = "",
|
||||
ConnectCount = jo["logincount"].ToString(),
|
||||
RegistTime = "",
|
||||
EndTime = jo["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)
|
||||
{
|
||||
|
||||
var url = "?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf&type=setuser&user="+account+"&new_pwd="+pwd;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = "";
|
||||
using (var sr = new StreamReader(resp.Content.ReadAsStreamAsync().Result, Encoding.GetEncoding("iso-8859-1")))
|
||||
{
|
||||
content = sr.ReadToEnd();
|
||||
}
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
if (status =="1")
|
||||
{
|
||||
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(ResultCode.C_INVALID_ERROR, "退款失败");
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否在线
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult<List<OriginAccountOnlineModel>>> OnLine(string account)
|
||||
{
|
||||
|
||||
var url = "?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf&type=get_user_onlinelog&user="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = "";
|
||||
using (var sr = new StreamReader(resp.Content.ReadAsStreamAsync().Result, Encoding.GetEncoding("iso-8859-1")))
|
||||
{
|
||||
content = sr.ReadToEnd();
|
||||
}
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
var retData = new List<OriginAccountOnlineModel>();
|
||||
if (status =="1")
|
||||
{
|
||||
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["server_ip"].ToString(),
|
||||
LoginTime = "",
|
||||
OnlineTime = jsondata["online_time"].ToString(),
|
||||
LoginIP = jsondata["client_ip"].ToString(),
|
||||
UpStream = "",
|
||||
DownStream = "",
|
||||
Id= "{user:\""+account+"\",address:\""+jsondata["address"].ToString()+"\",server_ip:\""+jsondata["server_ip"].ToString()+"\"}",
|
||||
|
||||
};
|
||||
|
||||
retData.Add(trData);
|
||||
}
|
||||
}
|
||||
return new ApiResult<List<OriginAccountOnlineModel>>(retData);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ApiResult<List<OriginAccountOnlineModel>>(retData);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 踢号
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> KillOut( string id)
|
||||
{
|
||||
|
||||
JObject info = (JObject)JsonConvert.DeserializeObject(id);
|
||||
|
||||
var url = "?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf&type=user_online_offline&user="+info["user"].ToString()+"&address="+info["address"].ToString()+"&server_ip="+info["server_ip"].ToString();
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = "";
|
||||
using (var sr = new StreamReader(resp.Content.ReadAsStreamAsync().Result, Encoding.GetEncoding("iso-8859-1")))
|
||||
{
|
||||
content = sr.ReadToEnd();
|
||||
}
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
|
||||
if (status =="1")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在
|
||||
/// </summary>
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> Exist(string account)
|
||||
{
|
||||
var url = "?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf&type=getuserlenNum&user="+account;
|
||||
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
|
||||
var content = "";
|
||||
using (var sr = new StreamReader(resp.Content.ReadAsStreamAsync().Result, Encoding.GetEncoding("iso-8859-1")))
|
||||
{
|
||||
content = sr.ReadToEnd();
|
||||
}
|
||||
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["status"].ToString();
|
||||
|
||||
if (status =="success")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,6 +77,8 @@ namespace Hncore.Pass.Vpn.Service
|
||||
agent = new AgentClient16Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
if (product.GroupNO == "g17")
|
||||
agent = new AgentClient17Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
if (product.GroupNO == "g18")
|
||||
agent = new AgentClient18Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
agent.Product = product;
|
||||
return agent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user