mogu
This commit is contained in:
@@ -112,7 +112,7 @@ namespace Home.Controllers
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "7";
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
m.Title = "9";
|
||||
@@ -138,7 +138,7 @@ namespace Home.Controllers
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "7";
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
m.Title = "9";
|
||||
@@ -164,7 +164,7 @@ namespace Home.Controllers
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "7";
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
m.Title = "9";
|
||||
@@ -923,7 +923,7 @@ namespace Home.Controllers
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "7";
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
m.Title = "9";
|
||||
@@ -961,7 +961,7 @@ namespace Home.Controllers
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 18){
|
||||
m.Title = "7";
|
||||
m.Title = "8";
|
||||
}
|
||||
if (m.ProductId == 6||m.ProductId == 5){
|
||||
m.Title = "9";
|
||||
|
||||
@@ -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;">7折</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) {
|
||||
@@ -77,6 +77,16 @@
|
||||
<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>
|
||||
</li>
|
||||
}
|
||||
|
||||
else if(item.Product.Id == 22) {
|
||||
<li >
|
||||
<a style="color:#0098fb"><span class="glyphicon glyphicon-arrow-down"></span>静态IP<span class="glyphicon glyphicon-arrow-down"></span></a>
|
||||
</li>
|
||||
|
||||
<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 </a>
|
||||
</li>
|
||||
}
|
||||
else if(item.Product.Id == 21) {
|
||||
|
||||
<li >
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<p>·带宽6-10兆</p>
|
||||
<p>·断开再链接换ip</p>
|
||||
</ul>
|
||||
@foreach (var package in Model.Packages.Where(m=>m.IsTest==0&&m.Status==1 && m.Id != 21).OrderBy(m => m.TenantId))
|
||||
@foreach (var package in Model.Packages.Where(m=>m.IsTest==0&&m.Status==1 && m.Id != 21&& m.Id != 20).OrderBy(m => m.TenantId))
|
||||
{
|
||||
@if(package.Id == 101||package.Id == 103||package.Id == 104||(package.Id>103)){
|
||||
<a asp-action="rebuy" asp-controller="Product" asp-route-packageId="@package.Id" asp-route-accounts=@ViewBag.accounts>
|
||||
|
||||
@@ -232,10 +232,10 @@
|
||||
this.search_field = '蘑菇IP';
|
||||
this.sstp = '4430';
|
||||
break;
|
||||
case 19:
|
||||
this.l2tp = '123';
|
||||
case 22:
|
||||
this.l2tp = '888888';
|
||||
this.search_field = '火狐IP';
|
||||
this.sstp = '1500';
|
||||
this.sstp = '5908';
|
||||
break;
|
||||
}
|
||||
$.ajax({
|
||||
@@ -353,7 +353,7 @@
|
||||
case 18:
|
||||
self.location.href='http://php-api.juip.com/script/linedata/data/download/mogu.csv';
|
||||
break;
|
||||
case 19:
|
||||
case 22:
|
||||
self.location.href='http://php-api.juip.com/script/linedata/data/download/huohu.csv';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
height: 0px;
|
||||
border: 1.0rem solid #FF9933;
|
||||
border-right-color: transparent;
|
||||
content: "7折+送 1 天";
|
||||
content: "8折";
|
||||
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
height: 0px;
|
||||
border: 1.0rem solid #FF9933;
|
||||
border-right-color: transparent;
|
||||
content: "7折+送 3 天";
|
||||
content: "8折+送 1 天";
|
||||
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
height: 0px;
|
||||
border: 1.0rem solid #FF9933;
|
||||
border-right-color: transparent;
|
||||
content: "7折+送 10 天";
|
||||
content: "8折+送 5 天";
|
||||
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
height: 0px;
|
||||
border: 1.0rem solid #FF9933;
|
||||
border-right-color: transparent;
|
||||
content: "7折+送 1 月";
|
||||
content: "8折+送 1 月";
|
||||
box-shadow: 0px 0.3125rem 0.3125rem -0.3125rem #000;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@
|
||||
@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;">7折</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>
|
||||
@@ -407,6 +407,11 @@
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
else if(item.Product.Id == 22) {
|
||||
<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 == 21) {
|
||||
|
||||
@@ -482,7 +487,7 @@
|
||||
</div> *@
|
||||
}
|
||||
@if(item.Product.Id == 18){
|
||||
<p class="youhuiNew" style="color: #FF9900;">天卡买一送一,周卡送3天,月卡送10天,双月卡送1个月,聚IP年中回馈,赠送力度史无前例!<br>(新开和续费都可参加,您可对同一账号多次续费都有赠送,每位会员不限账号数量,您可购买多个IP账号都有赠送)<br>新产品上线,全新IP池!</p>
|
||||
<p class="youhuiNew" style="color: #FF9900;">周卡送1天,月卡送5天<br>(新开和续费都可参加,您可对同一账号多次续费都有赠送,每位会员不限账号数量,您可购买多个IP账号都有赠送)<br>新产品上线,全新IP池!</p>
|
||||
<p class="youhuiNew" style="color: #0066CC;padding:0;margin:0;">本产品目前所有地区都屏蔽QQ微信</p>
|
||||
@* <div style="text-align:center;cursor:pointer;padding: 0px;margin:0px;font-size:15px;font-weight:bold;color:red;" title="目前公布要停的地区为:
|
||||
南京,重庆,六盘水,遵义,海口,无锡,常州,苏州,
|
||||
@@ -554,6 +559,48 @@
|
||||
长沙,长春,兰州,哈尔滨,太原,运城,晋中,南宁,西宁,中卫" style="color: #000000;">查看详细地区 </span>
|
||||
</div> *@
|
||||
}
|
||||
|
||||
@if(item.Product.Id == 6){
|
||||
<div style="text-align:center;cursor:pointer;padding: 0px;margin:0px;font-size:15px;font-weight:bold;color:red;" ><span
|
||||
data-container="body" data-toggle="popover" data-placement="auto top"
|
||||
data-content="微信qq不可用:
|
||||
广东:韶关、肇庆、珠海、云浮、阳江,茂名,东莞、佛山,珠海、中山,汕头
|
||||
江西: 吉安,新余
|
||||
直辖市:天津、北京
|
||||
江苏:扬州、杭州、本溪,常州、泰州,连云港
|
||||
湖南:怀化、郴州、株洲、长沙、湘潭、吉首
|
||||
四川:乐山,阿坝,资阳,德阳,内江、绵阳
|
||||
安徽:池州,淮南,铜陵
|
||||
浙江:丽水、舟山、湖州、徐州、温州
|
||||
山东:济南,烟台、淄博、威海、莱芜,滨州
|
||||
甘肃:武威
|
||||
河北:保定、承德、
|
||||
贵州:遵义、六盘水
|
||||
内蒙古:兴安盟
|
||||
辽宁:抚顺、铁岭
|
||||
福建:宁德、福州
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
微信qq可用:
|
||||
内蒙古:通辽
|
||||
四川:成都,雅安,遂宁,攀枝花
|
||||
宁夏:石嘴山,
|
||||
山东:枣庄,青岛
|
||||
广东:广州
|
||||
江苏:镇江,淮安
|
||||
江西:宜春
|
||||
河北:唐山
|
||||
河南:信阳,濮阳
|
||||
浙江:衢州,金华
|
||||
海南:三亚
|
||||
湖北:黄冈,黄石,襄阳,荆门
|
||||
福建:泉州,漳州,三明,厦门,莆田
|
||||
辽宁:营口,葫芦岛,鞍山
|
||||
陕西:延安,西安
|
||||
青海:黄南
|
||||
黑龙江:哈尔滨
|
||||
" style="color: #000000;">点击查看屏蔽微信QQ的地区 </span>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -138,6 +138,14 @@
|
||||
<div class="item" style="margin-bottom: 5px;">
|
||||
<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="btn btn-sdefault" style="width: auto;">蘑菇IP-电脑端</button></a>
|
||||
</div>
|
||||
|
||||
<div class="item" style="margin-bottom: 5px;">
|
||||
<a href="http://client.syssuper.com:8000/soft/huohupubnet.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.cn98.net:8000/huohupubnet.apk"> <button type="button" class="btn btn-sdefault" style="width: auto;">火狐IP-安卓端</button></a>
|
||||
</div>
|
||||
<p>免安装,下载后直接打开</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
{"userpass",pwd},
|
||||
{"qq","123456789"},
|
||||
{"time",time},
|
||||
{"num","1"},
|
||||
{"num",connCount.ToString()},
|
||||
{"type",type},
|
||||
{"ip","1"},
|
||||
{"remark","api开通"},
|
||||
@@ -269,46 +269,41 @@ namespace Hncore.Pass.Vpn.Service
|
||||
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 = "b220b83508db57f44e5ce86a7b34cae9";
|
||||
var sign = MD5(time_s+nonce+apikey);
|
||||
|
||||
var url = "/api/raduserInfo?agentid="+agentid+"&ti="+time_s+"&nonce="+nonce+"&sign="+sign+"&username="+account;
|
||||
|
||||
// 获取token
|
||||
var url = "api/auth/access_token";
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var map = new Dictionary<string, string>(){
|
||||
{"app_id","416" },
|
||||
{"app_key","882453f7cdb7525a4362d1776e937086" },
|
||||
};
|
||||
var resp = await client.PostAsForm(url, map);
|
||||
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 token = jo["data"]["access_token"];
|
||||
//正式请求
|
||||
var url_p = "api/user/user_renew_vpn";
|
||||
var client_p = CreateHttpClient();
|
||||
var map_p = new Dictionary<string, string>(){
|
||||
{"access_token",token.ToString() },
|
||||
{"username[]",account},
|
||||
};
|
||||
var resp_p = await client_p.PostAsForm(url_p, map_p);
|
||||
var content_p = await resp_p.Content.ReadAsStringAsync();
|
||||
JObject jo_p = (JObject)JsonConvert.DeserializeObject(content_p);
|
||||
Console.WriteLine("========================================开号============================================");
|
||||
Console.WriteLine(content_p);
|
||||
Console.WriteLine(jo_p);
|
||||
Console.WriteLine("=====================================================================================");
|
||||
var data = jo_p["data"]["data"][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, "没有查询到信息");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
427
Services/Hncore.Pass.Vpn/Service/AgentClient17Service.cs
Normal file
427
Services/Hncore.Pass.Vpn/Service/AgentClient17Service.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 AgentClient17Service: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 AgentClient17Service(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,8 @@ namespace Hncore.Pass.Vpn.Service
|
||||
agent = new AgentClient15Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
if (product.GroupNO == "g16")
|
||||
agent = new AgentClient16Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
if (product.GroupNO == "g17")
|
||||
agent = new AgentClient17Service(m_HttpClientFactory) { ClientName = product.GroupNO };
|
||||
agent.Product = product;
|
||||
return agent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user