先锋 神龙
This commit is contained in:
@@ -739,7 +739,7 @@ namespace Home.Controllers
|
||||
{
|
||||
var product = new ProductEntity();
|
||||
var package = new ProductPackageEntity();
|
||||
if (id==1034||id==1040||id==89||id==1094||id==1103||id==1097){
|
||||
if (id==1034||id==1040||id==89||id==1094||id==1103||id==1097||id==60||id==1114){
|
||||
package = await m_ProductPackageService.Query(m => m.Id == id).FirstOrDefaultAsync();
|
||||
product = await m_ProductService.GetById(package.ProductId);
|
||||
} else {
|
||||
@@ -928,6 +928,37 @@ namespace Home.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
//0 无状态 1:尊享 2:高级 3:普通
|
||||
var pro_type_flag_xianfeng = 0;
|
||||
var pro_type_temp_xianfeng = 0;
|
||||
if (productId == 6) {
|
||||
|
||||
|
||||
|
||||
accountList.ForEach(m => {
|
||||
|
||||
|
||||
if (m.PackageId<61) {
|
||||
pro_type_flag_xianfeng = 1;
|
||||
}
|
||||
if (m.PackageId>1108&&m.PackageId<1115) {
|
||||
pro_type_flag_xianfeng = 2;
|
||||
}
|
||||
|
||||
if (pro_type_temp_xianfeng==0){
|
||||
pro_type_temp_xianfeng = pro_type_flag_xianfeng;
|
||||
}
|
||||
if (pro_type_temp_xianfeng!=pro_type_flag_xianfeng){
|
||||
ViewBag.errorTip = "先锋不同类型不能同时续费";
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (ViewBag.errorTip == "先锋不同类型不能同时续费"){
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1004,6 +1035,13 @@ namespace Home.Controllers
|
||||
if (pro_type_temp_liebao ==3 && m.Id>1103&&m.Id<1109) {
|
||||
package_temp.Add(m);
|
||||
}
|
||||
}else if(m.ProductId == 6){
|
||||
if (pro_type_temp_xianfeng ==1 && m.Id<61) {
|
||||
package_temp.Add(m);
|
||||
}
|
||||
if (pro_type_temp_xianfeng ==2 && m.Id>1108&&m.Id<1115) {
|
||||
package_temp.Add(m);
|
||||
}
|
||||
} else {
|
||||
package_temp.Add(m);
|
||||
}
|
||||
@@ -1056,6 +1094,13 @@ namespace Home.Controllers
|
||||
if (pro_type_temp_liebao ==3 && m.Id>1103&&m.Id<1109) {
|
||||
package_temp.Add(m);
|
||||
}
|
||||
}else if(m.ProductId == 6){
|
||||
if (pro_type_temp_xianfeng ==1 && m.Id<61) {
|
||||
package_temp.Add(m);
|
||||
}
|
||||
if (pro_type_temp_xianfeng ==2 && m.Id>1108&&m.Id<1115) {
|
||||
package_temp.Add(m);
|
||||
}
|
||||
} else {
|
||||
package_temp.Add(m);
|
||||
}
|
||||
|
||||
@@ -314,9 +314,9 @@
|
||||
this.sstp = '4430';
|
||||
break;
|
||||
case 6:
|
||||
this.l2tp = '123';
|
||||
this.l2tp = '6666';
|
||||
this.search_field = '先锋IP';
|
||||
this.sstp = '6665';
|
||||
this.sstp = '889';
|
||||
break;
|
||||
case 10:
|
||||
this.l2tp = '88';
|
||||
@@ -379,6 +379,11 @@
|
||||
this.search_field = '强子静态IP';
|
||||
this.sstp = '1500';
|
||||
break;
|
||||
case 26:
|
||||
this.l2tp = '1234';
|
||||
this.search_field = '强子静态IP';
|
||||
this.sstp = '4430';
|
||||
break;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
|
||||
@@ -175,6 +175,10 @@
|
||||
<li role="presentation" class="@(item.Product.Id==defaultProduct.Id?"active":"")">
|
||||
<a href="#@item.Product.Id" id="p26" role="tab" data-toggle="tab" style="font-size: 25px;border:1px solid #99CCFF">@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">新</span></a>
|
||||
</li>
|
||||
}else if(item.Product.Id == 6) {
|
||||
<li role="presentation" class="@(item.Product.Id==defaultProduct.Id?"active":"")">
|
||||
<a href="#@item.Product.Id" id="p6" role="tab" data-toggle="tab" style="font-size: 25px;border:1px solid #99CCFF">@item.Product.Name<span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">新</span></a>
|
||||
</li>
|
||||
}
|
||||
else if(item.Product.Id == 22) {
|
||||
<li >
|
||||
@@ -234,6 +238,13 @@
|
||||
<button type="button" onclick="lbgaoji()" class="btn btn-default btn-lg lbgj" style="background-color: white;font-size:1.3em;">高级版-限速4M</button><br>
|
||||
<button type="button" onclick="lbputong()" class="btn btn-default btn-lg lbpt" style="background-color: white;font-size:1.3em;margin-top:10px;">普通版-限速2M</button>
|
||||
</div>
|
||||
}
|
||||
@if (item.Product.Id == 6){
|
||||
<div class="p_type @("type"+item.Product.Id)" style="padding-top: 10px;">
|
||||
<button type="button" onclick="xfgaoji()" class="btn btn-default btn-lg xfgj" style="background-color: #FF9900;font-size:1.3em;">高级 2-6M</button>
|
||||
<button type="button" onclick="xfduxiang()" class="btn btn-default btn-lg xfdx" style="background-color: white;font-size:1.3em;">独享 3-10M</button><br>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (item.Product.Id == 20) {
|
||||
@@ -261,7 +272,7 @@
|
||||
|
||||
@foreach (var package in item.Packages.Where(m => m.Status == 1&&(m.TenantId==1157||m.TenantId==9999||m.TenantId==10000)).OrderBy(m => m.TenantId))
|
||||
{
|
||||
if (package.IsTest == 1 &&package.Id != 89&&package.Id != 1034&&package.Id != 1040&&package.Id != 1094&&package.Id != 1097&&package.Id != 1103)
|
||||
if (package.IsTest == 1 &&package.Id != 89&&package.Id != 1034&&package.Id != 1040&&package.Id != 1094&&package.Id != 1097&&package.Id != 60&&package.Id != 1114)
|
||||
{
|
||||
<a asp-action="test" id="@("package-"+package.Id)" asp-controller="product" asp-route-id="@package.ProductId">
|
||||
<div class="card color_2">
|
||||
@@ -293,7 +304,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
} else if((package.Id == 89||package.Id == 1034||package.Id == 1040||package.Id == 1094||package.Id == 1097||package.Id == 1103)&&package.IsTest==1){
|
||||
} else if((package.Id == 89||package.Id == 1034||package.Id == 1040||package.Id == 1094||package.Id == 1097||package.Id == 1103||package.Id == 60||package.Id == 1114)&&package.IsTest==1){
|
||||
<a asp-action="test" id="@("package-"+package.Id)" asp-controller="product" asp-route-id="@package.Id">
|
||||
<div class="card color_2">
|
||||
<div class="item">
|
||||
@@ -347,6 +358,7 @@
|
||||
$("#p14").click(function () {
|
||||
$(".type14").show();
|
||||
$(".type26").hide();
|
||||
$(".type6").hide();
|
||||
$("#package-89").show();
|
||||
$("#package-69").show();
|
||||
$("#package-70").show();
|
||||
@@ -364,6 +376,7 @@
|
||||
$("#p26").click(function () {
|
||||
$(".type14").hide();
|
||||
$(".type26").show();
|
||||
$(".type6").hide();
|
||||
|
||||
for (var i=1090;i<1097;i++){
|
||||
$("#package-"+i).show();
|
||||
@@ -375,6 +388,21 @@
|
||||
$(".lbgj").css('background-color','white');
|
||||
$(".lbpt").css('background-color','white');
|
||||
});
|
||||
$("#p6").click(function () {
|
||||
$(".type14").hide();
|
||||
$(".type26").hide();
|
||||
$(".type6").show();
|
||||
|
||||
$("#package-60").show();
|
||||
for (var i=22;i<27;i++){
|
||||
$("#package-"+i).show();
|
||||
}
|
||||
for (var i=1109;i<1115;i++){
|
||||
$("#package-"+i).hide();
|
||||
}
|
||||
$(".xfgj").css('background-color','#FF9900');
|
||||
$(".xfdx").css('background-color','white');
|
||||
});
|
||||
function ttzhizun() {
|
||||
$("#package-89").show();
|
||||
$("#package-69").show();
|
||||
@@ -466,6 +494,28 @@
|
||||
$("#package-"+i).hide();
|
||||
}
|
||||
}
|
||||
function xfgaoji() {
|
||||
$(".xfgj").css('background-color','#FF9900');
|
||||
$(".xfdx").css('background-color','white');
|
||||
$("#package-60").show();
|
||||
for (var i=22;i<27;i++){
|
||||
$("#package-"+i).show();
|
||||
}
|
||||
for (var i=1109;i<1115;i++){
|
||||
$("#package-"+i).hide();
|
||||
}
|
||||
}
|
||||
function xfduxiang() {
|
||||
$(".xfdx").css('background-color','#FF9900');
|
||||
$(".xfgj").css('background-color','white');
|
||||
$("#package-60").hide();
|
||||
for (var i=22;i<27;i++){
|
||||
$("#package-"+i).hide();
|
||||
}
|
||||
for (var i=1109;i<1115;i++){
|
||||
$("#package-"+i).show();
|
||||
}
|
||||
}
|
||||
|
||||
var wjdxtype = 1;
|
||||
function wjdxphone() {
|
||||
|
||||
@@ -251,7 +251,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="visible-lg text-center text-new" style="position:fixed;left:9px;top:30%;color:#39516b;cursor:pointer;">
|
||||
<div class="visible-lg text-center text-new" style="position:fixed;left:9px;top:30%;color:#39516b;cursor:pointer;width:14%;">
|
||||
|
||||
<table class="table table-striped " >
|
||||
<tr>
|
||||
@@ -299,6 +299,11 @@
|
||||
<td>123</td>
|
||||
<td>1500</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>先锋</td>
|
||||
<td>6666</td>
|
||||
<td>889</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>极客</td>
|
||||
<td>123456</td>
|
||||
@@ -377,9 +382,9 @@
|
||||
this.sstp = '4430';
|
||||
break;
|
||||
case 6:
|
||||
this.l2tp = '123';
|
||||
this.l2tp = '6666';
|
||||
this.search_field = '先锋IP';
|
||||
this.sstp = '6665';
|
||||
this.sstp = '889';
|
||||
break;
|
||||
case 10:
|
||||
this.l2tp = '88';
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="col-sm-6 col-md-3 margin-top-30">
|
||||
<div class="panel panel-info relative">
|
||||
<div class="panel-heading">
|
||||
<h3 class="text-center">¥<input v-model="order_info.money" type="text" style="width:30%;" /></h3>
|
||||
<h3 class="text-center">¥<input v-model="order_info.money" type="number" style="width:30%;" /></h3>
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<div class="price-cercle">
|
||||
@@ -977,7 +977,7 @@ $(document).on("ready", function(e) {
|
||||
var that = this
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/product/linecount',
|
||||
url: 'http://php-api.juip.com/http/product/linecount',
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data:this.game,
|
||||
|
||||
@@ -265,6 +265,12 @@
|
||||
|
||||
</div>
|
||||
}
|
||||
else if(item.Product.Id == 6) {
|
||||
<div class="dropdown">
|
||||
<div style="font-size: 18px;" class="productItem" id="@("p"+item.Product.Id)" a-pid="@item.Product.Id"><span style="color: #f64e3d;font-weight:bold;float:right;padding-right: 5px;">新 </span>@item.Product.Name</div>
|
||||
|
||||
</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">@item.Product.Name</div>
|
||||
@@ -380,6 +386,18 @@
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
@if(item.Product.Id == 6) { //不限速
|
||||
<div style="padding:10px 170px;">
|
||||
<ul class="nav nav-tabs nav-justified" style="margin:0 0 0 50px;cursor: pointer;">
|
||||
<li id="xfgaoji" style="border:1px solid #ccc" class="active">
|
||||
<a onclick="xfgaoji()" style="color: #009966;width:350px;background:rgba(0,0,0,0)">高级 2-6M</a>
|
||||
</li>
|
||||
<li style="border:1px solid #ccc" id="xfduxiang">
|
||||
<a onclick="xfduxiang()" style="color: #009966;width:350px;background:rgba(0,0,0,0)">独享 3-10M</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@* @if(item.Product.Id == 18){
|
||||
@@ -465,7 +483,7 @@
|
||||
<div class="card" style="margin-top:30px;">
|
||||
<div style="display: flex;margin: 0 auto;">
|
||||
|
||||
@if(item.Product.TenantId == 1157 && item.Product.Content=="0" && item.Product.Id != 14&& item.Product.Id != 26){
|
||||
@if(item.Product.TenantId == 1157 && item.Product.Content=="0" && item.Product.Id != 14&& item.Product.Id != 26&& item.Product.Id != 6){
|
||||
<div class="item packageitem" a-test="true" id="@("pkgtest"+item.Product.Id)" a-pkg-id="@item.Product.Id">
|
||||
<p><span class="price">免费</span></p>
|
||||
<p class="yuanjia" style="color: #FF9900;text-decoration:none;"><span>@restStatus</span></p>
|
||||
@@ -478,7 +496,7 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@foreach (var package in item.Packages.Where(m => (m.IsTest == 0 && m.Status == 1) || (m.ProductId==14 && m.Status == 1) || (m.ProductId==26 && m.Status == 1) ).OrderBy(m => m.TenantId))
|
||||
@foreach (var package in item.Packages.Where(m => (m.IsTest == 0 && m.Status == 1) || (m.ProductId==14 && m.Status == 1) || (m.ProductId==26 && m.Status == 1)|| (m.ProductId==6 && m.Status == 1) ).OrderBy(m => m.TenantId))
|
||||
{
|
||||
@if(package.Title != "0"){
|
||||
<style>
|
||||
@@ -541,7 +559,7 @@
|
||||
</div>
|
||||
<img src="~/img/check.png" class="cardCheck">
|
||||
</div>
|
||||
} else if((package.Id == 89||package.Id == 1034||package.Id == 1040||package.Id == 1097||package.Id == 1094||package.Id == 1103)&&package.IsTest==1){
|
||||
} else if((package.Id == 89||package.Id == 1034||package.Id == 1040||package.Id == 1097||package.Id == 1094||package.Id == 1103||package.Id == 60||package.Id == 1114)&&package.IsTest==1){
|
||||
|
||||
<div class="item packageitem" a-test="true" id="@("pkg"+package.Id)" a-pkg-id="@package.Id">
|
||||
<p><span class="price">@package.Price</span>元</p>
|
||||
@@ -789,6 +807,28 @@
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
}
|
||||
function xfgaoji() {
|
||||
$("#xfduxiang").removeClass("active");
|
||||
$("#xfgaoji").addClass("active");
|
||||
$("#pkg60").show();
|
||||
for (var i=22;i<27;i++){
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
for (var i=1109;i<1115;i++){
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
}
|
||||
function xfduxiang() {
|
||||
$("#xfduxiang").addClass("active");
|
||||
$("#xfgaoji").removeClass("active");
|
||||
$("#pkg60").hide();
|
||||
for (var i=22;i<27;i++){
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
for (var i=1109;i<1115;i++){
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
}
|
||||
|
||||
//1 安卓、苹果 2 pc
|
||||
var wjdxtype = 1;
|
||||
@@ -980,6 +1020,17 @@
|
||||
for (var i=1;i<30;i++){
|
||||
$("#p"+i).removeClass("on");
|
||||
}
|
||||
} else if (pid == 6) {
|
||||
$("#pkg60").show();
|
||||
for (var i=22;i<27;i++){
|
||||
$("#pkg"+i).show();
|
||||
}
|
||||
for (var i=1109;i<1115;i++){
|
||||
$("#pkg"+i).hide();
|
||||
}
|
||||
for (var i=1;i<30;i++){
|
||||
$("#p"+i).removeClass("on");
|
||||
}
|
||||
} else if (pid == 20||pid == 21){
|
||||
if (pid ==20) {
|
||||
$("#wjdxgd").removeClass("active");
|
||||
|
||||
@@ -432,7 +432,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/user/lang_ip_list',
|
||||
url: 'http://php-api.juip.com/http/user/lang_ip_list',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -474,7 +474,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/user/cx_package',
|
||||
url: 'http://php-api.juip.com/http/user/cx_package',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -495,7 +495,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/user/cx_order',
|
||||
url: 'http://php-api.juip.com/http/user/cx_order',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -517,7 +517,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/user/cx_switch',
|
||||
url: 'http://php-api.juip.com/http/user/cx_switch',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -587,7 +587,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/product/out_city',
|
||||
url: 'http://php-api.juip.com/http/product/out_city',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -638,7 +638,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/product/in_city',
|
||||
url: 'http://php-api.juip.com/http/product/in_city',
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data:this.city_re_data,
|
||||
@@ -689,7 +689,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/order/rebuy_order',
|
||||
url: 'http://php-api.juip.com/http/order/rebuy_order',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -720,7 +720,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/order/change_ip_order',
|
||||
url: 'http://php-api.juip.com/http/order/change_ip_order',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
@@ -750,7 +750,7 @@
|
||||
};
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/product/calc_price',
|
||||
url: 'http://php-api.juip.com/http/product/calc_price',
|
||||
dataType: "json",
|
||||
async:false,
|
||||
data: this.order_info,
|
||||
@@ -796,7 +796,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/http/user/get_lang_ip',
|
||||
url: 'http://php-api.juip.com/http/user/get_lang_ip',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
|
||||
@@ -14,6 +14,8 @@ using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text;
|
||||
using System.Security.Cryptography;
|
||||
namespace Hncore.Pass.Vpn.Service
|
||||
{
|
||||
//先锋
|
||||
@@ -26,7 +28,6 @@ namespace Hncore.Pass.Vpn.Service
|
||||
string SingleReAddUrl { get; set; } = "agent/memberRenew.html";
|
||||
string MuiltAddUrl { get; set; } = "agent/memberMuiltAdd.html";
|
||||
string RefundUrl { get; set; } = "agent/memberRefund/id/{0}.html";
|
||||
string UpdateUrl = "agent/memberUpdate/id/{0}.html";//agent/memberUpdate/id/1155709.html
|
||||
string OnlineUrl { get; set; } = "agent/radiusOnline.html?search=1&username=";
|
||||
string ClientOnlineUrl { get; set; } = "agent/clientOnline.html?search=1&username=";
|
||||
string KIllUrl { get; set; } = "";
|
||||
@@ -51,14 +52,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
public override async Task<ApiResult> NewAccount(string packageKey, string account, string pwd, int connCount = 1, int accountType = 1, int payCount = 1)
|
||||
{
|
||||
|
||||
if(packageKey == "free"){
|
||||
return await NewTestAccount(packageKey, account, pwd, 1, accountType, 1);
|
||||
}
|
||||
var password = "y8sPoSPLUJvl6wjFzH70cQ==";
|
||||
|
||||
var secretId = "626B6170693231";
|
||||
var secretKey = "6b3fdfc206841f44c6609bf19c182a6a";
|
||||
|
||||
var url = "http://bkapi.pptp.biz/userapi/?secretId="+secretId+"&secretKey="+secretKey+"&type=adduser&user="+account+"&pass="+pwd+"&serverid="+packageKey+"&logincount="+connCount.ToString()+"&phone=17719092232&cardname=万永康&cardno=410325199810129916";
|
||||
var url = "http://webapi.shenlongip.com/buyvpn?username=admin1&password="+password+"&mealId="+packageKey+"&vpnAccount="+account+"&vpnPassword="+pwd+"&links="+connCount;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
@@ -70,7 +66,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
|
||||
|
||||
|
||||
if (status =="1")
|
||||
if (status =="0")
|
||||
{
|
||||
return new ApiResult(ResultCode.C_SUCCESS);
|
||||
}
|
||||
@@ -99,12 +95,6 @@ namespace Hncore.Pass.Vpn.Service
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
Console.WriteLine("==================================================");
|
||||
Console.WriteLine(jo);
|
||||
Console.WriteLine("==================================================");
|
||||
|
||||
|
||||
|
||||
|
||||
if (status =="1")
|
||||
{
|
||||
@@ -123,10 +113,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
public override async Task<ApiResult> NewReAccount(string packageKey, string account, int connCount, int payCount = 1)
|
||||
{
|
||||
|
||||
var secretId = "626B6170693231";
|
||||
var secretKey = "6b3fdfc206841f44c6609bf19c182a6a";
|
||||
var password = "y8sPoSPLUJvl6wjFzH70cQ==";
|
||||
|
||||
var url = "http://bkapi.pptp.biz/userapi/?secretId="+secretId+"&secretKey="+secretKey+"&type=buy&user="+account+"&serverid="+packageKey+"&logincount="+connCount.ToString()+"&phone=17719092232&cardname=万永康&cardno=410325199810129916";
|
||||
var url = "http://webapi.shenlongip.com/renewvpn?username=admin1&password="+password+"&mealId="+packageKey+"&vpnAccount="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
@@ -135,8 +124,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
|
||||
if (status =="1")
|
||||
if (status =="0")
|
||||
{
|
||||
return new ApiResult(1);
|
||||
}
|
||||
@@ -151,6 +139,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> DeleteAccount(string account)
|
||||
{
|
||||
return false;
|
||||
var client = CreateHttpClient();
|
||||
var infoRet = await this.GetAccountInfo(account, true);
|
||||
if (infoRet.Code != ResultCode.C_SUCCESS)
|
||||
@@ -189,10 +178,10 @@ namespace Hncore.Pass.Vpn.Service
|
||||
public override async Task<ApiResult<OriginAccountModel>> GetAccountInfo(string account,bool isTest=false)
|
||||
{
|
||||
|
||||
var secretId = "626B6170693231";
|
||||
var secretKey = "6b3fdfc206841f44c6609bf19c182a6a";
|
||||
|
||||
var url = "http://bkapi.pptp.biz/userapi/?secretId="+secretId+"&secretKey="+secretKey+"&type=getuserinfo&user="+account;
|
||||
var password = "y8sPoSPLUJvl6wjFzH70cQ==";
|
||||
|
||||
var url = "http://webapi.shenlongip.com/searchvpn?username=admin1&password="+password+"&vpnAccount="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
@@ -201,23 +190,18 @@ namespace Hncore.Pass.Vpn.Service
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
Console.WriteLine("---------------------------------------------------------------");
|
||||
Console.WriteLine(jo);
|
||||
Console.WriteLine("---------------------------------------------------------------");
|
||||
|
||||
|
||||
if (status =="1")
|
||||
if (status =="0")
|
||||
{
|
||||
var trData = new OriginAccountModel
|
||||
{
|
||||
Account = account,
|
||||
Pwd = "",
|
||||
AccountType = "",
|
||||
Package = "",
|
||||
Pwd = jo["data"]["vpnPassword"].ToString(),
|
||||
AccountType = jo["data"]["mealType"].ToString(),
|
||||
Package = jo["data"]["mealType"].ToString(),
|
||||
RegistTime = "",
|
||||
EndTime = jo["expiretime"].ToString(),
|
||||
EndTime = "",
|
||||
RestTime = "",
|
||||
ConnectCount = jo["logincount"].ToString(),
|
||||
ConnectCount = jo["data"]["mealTylinkspe"].ToString(),
|
||||
Amount = "",
|
||||
IsActive = "",
|
||||
Remark = "",
|
||||
@@ -238,10 +222,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
public override async Task<bool> UpdateAccountPwd(string account, string pwd)
|
||||
{
|
||||
|
||||
var secretId = "626B6170693231";
|
||||
var secretKey = "6b3fdfc206841f44c6609bf19c182a6a";
|
||||
var password = "y8sPoSPLUJvl6wjFzH70cQ==";
|
||||
|
||||
var url = "http://bkapi.pptp.biz/userapi/?secretId="+secretId+"&secretKey="+secretKey+"&type=setuser&user="+account+"&&new_pwd="+pwd;
|
||||
var url = "http://webapi.shenlongip.com/vpnpasswd?username=admin1&password="+password+"&vpnAccount="+account+"&newVpnPasswd="+pwd;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
@@ -250,7 +233,8 @@ namespace Hncore.Pass.Vpn.Service
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
if (status =="1")
|
||||
|
||||
if (status =="0")
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
@@ -266,31 +250,24 @@ namespace Hncore.Pass.Vpn.Service
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult> Refund(string account, string packageKey, int days)
|
||||
{
|
||||
var password = "y8sPoSPLUJvl6wjFzH70cQ==";
|
||||
|
||||
var url = "http://webapi.shenlongip.com/refundvpn?username=admin1&password="+password+"&vpnAccount="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
var title = GetOpTitle("Refund", account);
|
||||
try
|
||||
{
|
||||
var accountInfo = await this.GetAccountInfo(account);
|
||||
if (accountInfo.Code != ResultCode.C_SUCCESS)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "退款失败");
|
||||
}
|
||||
var url = string.Format(this.RefundUrl, accountInfo.Data.Id);
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
if (content.Has() && content.IndexOf("退款成功!") != -1)
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
|
||||
if (status =="0")
|
||||
{
|
||||
return new ApiResult(1);
|
||||
}
|
||||
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, "退款失败");
|
||||
}
|
||||
}
|
||||
@@ -302,11 +279,11 @@ namespace Hncore.Pass.Vpn.Service
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult<List<OriginAccountOnlineModel>>> OnLine(string account)
|
||||
{
|
||||
var retData = new List<OriginAccountOnlineModel>();
|
||||
|
||||
var secretId = "626B6170693231";
|
||||
var secretKey = "6b3fdfc206841f44c6609bf19c182a6a";
|
||||
var password = "y8sPoSPLUJvl6wjFzH70cQ==";
|
||||
|
||||
var url = "http://bkapi.pptp.biz/userapi3/?secretId="+secretId+"&secretKey="+secretKey+"&type=get_user_onlinelog&user="+account;
|
||||
var url = "http://webapi.shenlongip.com/searchvpn/links?username=admin1&password="+password+"&vpnAccount="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
@@ -314,8 +291,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
var retData = new List<OriginAccountOnlineModel>();
|
||||
if (status =="1")
|
||||
|
||||
|
||||
if (status =="0")
|
||||
{
|
||||
if(jo.ContainsKey("data")){
|
||||
foreach (var tr in jo["data"])
|
||||
@@ -325,13 +303,13 @@ namespace Hncore.Pass.Vpn.Service
|
||||
var trData = new OriginAccountOnlineModel
|
||||
{
|
||||
Account = account,
|
||||
ServerIP = jsondata["server_ip"].ToString(),
|
||||
ServerIP = jsondata["clients"]["outIp"].ToString(),
|
||||
LoginTime = "",
|
||||
OnlineTime = jsondata["online_time"].ToString(),
|
||||
LoginIP = jsondata["client_ip"].ToString(),
|
||||
OnlineTime = "",
|
||||
LoginIP = jsondata["clients"]["userIp"].ToString(),
|
||||
UpStream = "",
|
||||
DownStream = "",
|
||||
Id = "user="+account+"-address="+jsondata["address"].ToString()+"-server_ip="+jsondata["server_ip"].ToString(),
|
||||
Id = account,
|
||||
|
||||
};
|
||||
|
||||
@@ -340,7 +318,7 @@ namespace Hncore.Pass.Vpn.Service
|
||||
}
|
||||
return new ApiResult<List<OriginAccountOnlineModel>>(retData);
|
||||
} else {
|
||||
return new ApiResult<List<OriginAccountOnlineModel>>(retData);
|
||||
return new ApiResult<List<OriginAccountOnlineModel>>();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -352,15 +330,10 @@ namespace Hncore.Pass.Vpn.Service
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> KillOut(string id)
|
||||
{
|
||||
var ids = "";
|
||||
if(id.Contains("-")){
|
||||
string[] arrStr = id.Split('-');
|
||||
ids = arrStr[0]+"&"+arrStr[1]+"&"+arrStr[2];
|
||||
}
|
||||
var secretId = "626B6170693231";
|
||||
var secretKey = "6b3fdfc206841f44c6609bf19c182a6a";
|
||||
|
||||
var url = "http://bkapi.pptp.biz/userapi3/?secretId="+secretId+"&secretKey="+secretKey+"&type=user_online_offline&"+ids;
|
||||
var password = "y8sPoSPLUJvl6wjFzH70cQ==";
|
||||
|
||||
var url = "http://webapi.shenlongip.com/kickvpn?username=admin1&password="+password+"&vpnAccount="+id;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
@@ -368,7 +341,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
if (status =="1")
|
||||
|
||||
|
||||
if (status =="0")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -399,12 +374,9 @@ namespace Hncore.Pass.Vpn.Service
|
||||
|
||||
public override async Task<bool> Exist(string account)
|
||||
{
|
||||
var password = "y8sPoSPLUJvl6wjFzH70cQ==";
|
||||
|
||||
|
||||
var secretId = "626B6170693231";
|
||||
var secretKey = "6b3fdfc206841f44c6609bf19c182a6a";
|
||||
|
||||
var url = "http://bkapi.pptp.biz/userapi3/?secretId="+secretId+"&secretKey="+secretKey+"&type=getuserlenNum&user="+account;
|
||||
var url = "http://webapi.shenlongip.com/searchvpn?username=admin1&password="+password+"&vpnAccount="+account;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
@@ -414,17 +386,37 @@ namespace Hncore.Pass.Vpn.Service
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
|
||||
|
||||
Console.WriteLine("================test==================================");
|
||||
Console.WriteLine(jo);
|
||||
Console.WriteLine("==================================================");
|
||||
|
||||
|
||||
if (status =="1")
|
||||
if (status =="0")
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public string AesEncrypt(string content, string aesKey, string aesIV)
|
||||
{
|
||||
|
||||
byte[] byteKEY = Encoding.UTF8.GetBytes(aesKey);
|
||||
byte[] byteIV = Encoding.UTF8.GetBytes(aesIV);
|
||||
|
||||
byte[] byteContnet = Encoding.UTF8.GetBytes(content);
|
||||
|
||||
var _aes = new RijndaelManaged();
|
||||
_aes.Padding = PaddingMode.PKCS7;
|
||||
_aes.Mode = CipherMode.CBC;
|
||||
|
||||
_aes.Key = byteKEY;
|
||||
_aes.IV = byteIV;
|
||||
|
||||
var _crypto = _aes.CreateEncryptor(byteKEY, byteIV);
|
||||
byte[] decrypted = _crypto.TransformFinalBlock(
|
||||
byteContnet, 0, byteContnet.Length);
|
||||
|
||||
_crypto.Dispose();
|
||||
|
||||
return Convert.ToBase64String(decrypted);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user