上传使用协议
This commit is contained in:
@@ -481,7 +481,7 @@
|
||||
<div class="col-lg-6">
|
||||
<div class="zhanghu">
|
||||
<div class="accout_tit"><span class="lineBar"></span>账户信息
|
||||
@* <a href="/user/upload" style="float:right;">上传协议书</a> *@
|
||||
<a href="/user/upload" style="float:right;">上传协议书</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 accoutLeft">
|
||||
|
||||
@@ -2,24 +2,77 @@
|
||||
@{
|
||||
Layout = "_UserLayout";
|
||||
}
|
||||
<div id="app">
|
||||
<div id="upload">
|
||||
<h3>上传使用协议</h3>
|
||||
|
||||
<form action="upload.php" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="file">
|
||||
<input type="submit" value="上传">
|
||||
<form enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="name">描述业务用途<span class="glyphicon glyphicon-asterisk" style="color:red;"></span>:</label>
|
||||
<input type="text" v-model="describe" class="form-control" id="name" placeholder="请描述业务用途">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xieyi">上传使用协议<span class="glyphicon glyphicon-asterisk" style="color:red;"></span>:</label>
|
||||
<input type="file" id="xieyi" name="xieyi" accept="image/*">
|
||||
<p class="help-block">上传签订的安全使用协议书 <a href="http://zip.juip.com/%E4%BD%BF%E7%94%A8%E5%8D%8F%E8%AE%AE%E4%B9%A6.zip">下载使用协议样板</a></p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="yewu">上传业务视频:</label>
|
||||
<input type="file" id="yewu" name="yewu" accept="video/wmv, video/avi, video/mp4, video/flv, video/3gp, video/mov, video/mkv, video/vob">
|
||||
<p class="help-block">上传涉及我方产品的业务视频</p>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
<button v-on:click="upload_file()" class="btn btn-new ">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var vm = new Vue({
|
||||
el:'#app',
|
||||
var vm = new Vue({
|
||||
el:'#upload',
|
||||
data:{
|
||||
|
||||
describe:'',
|
||||
},
|
||||
created:function(){
|
||||
|
||||
},
|
||||
methods:{
|
||||
|
||||
upload_file() {
|
||||
|
||||
var xieyi = document.getElementById("xieyi").files[0];
|
||||
|
||||
if (this.describe.length < 2) {
|
||||
alert("业务描述必须填写!");
|
||||
return;
|
||||
}
|
||||
if (!xieyi) {
|
||||
alert("协议文件必须上传!");
|
||||
return;
|
||||
}
|
||||
|
||||
var form_data = new FormData();
|
||||
form_data.append('cookie',document.cookie);
|
||||
form_data.append('describe',this.describe);
|
||||
form_data.append('xieyi',xieyi);
|
||||
form_data.append('yewu',document.getElementById("yewu").files[0]);
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'http://juip.wyk/tencent/index/upload',
|
||||
dataType: "json",
|
||||
async:false,
|
||||
contentType:false,//如果请求参数是FormData 必须设置 contentType请求头为false
|
||||
processData:false,//如果请求参数是FormData 必须设置 processData请求头为false
|
||||
data: form_data,
|
||||
beforeSend: function(xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: function (res) {
|
||||
alert(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -369,46 +369,51 @@ namespace Hncore.Pass.Vpn.Service
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult<List<OriginAccountOnlineModel>>> OnLine(string account)
|
||||
{
|
||||
var acc = "";
|
||||
var type = "";
|
||||
string[] arrStr = account.Split('-');
|
||||
acc = arrStr[0];
|
||||
type = arrStr[1];
|
||||
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
Dictionary<string, string> map = new Dictionary<string, string>(){
|
||||
{"type",type },
|
||||
{"account",acc },
|
||||
};
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "0c4641686764e0ee56ef54b16fddc966";
|
||||
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);
|
||||
map = signAct(map);
|
||||
|
||||
var client = CreateHttpClient();
|
||||
var resp = await client.PostAsForm("https://jyip.net/open-api/account-is-online", map);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["errcode"].ToString();
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
var retData = new List<OriginAccountOnlineModel>();
|
||||
if (status =="0")
|
||||
|
||||
if (status == "200")
|
||||
{
|
||||
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);
|
||||
if (jsondata["is_online"].ToString() == "1") {
|
||||
var trData = new OriginAccountOnlineModel
|
||||
{
|
||||
Account = acc,
|
||||
ServerIP = "",
|
||||
LoginTime = "",
|
||||
OnlineTime = "",
|
||||
LoginIP = "",
|
||||
UpStream = "",
|
||||
DownStream = "",
|
||||
Id= "{account:\""+acc+"\",type:\""+type.ToString()+"\"}",
|
||||
|
||||
};
|
||||
|
||||
retData.Add(trData);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return new ApiResult<List<OriginAccountOnlineModel>>(retData);
|
||||
@@ -427,41 +432,28 @@ namespace Hncore.Pass.Vpn.Service
|
||||
/// <returns></returns>
|
||||
public override async Task<bool> KillOut( string id)
|
||||
{
|
||||
|
||||
Random rd = new Random(Guid.NewGuid().GetHashCode());
|
||||
int i = rd.Next();
|
||||
|
||||
var time_s = DateTime.Now.GetUnixTimeStamp();
|
||||
var agentid = "admin1";
|
||||
var nonce = MD5(time_s.ToString()) + i.ToString();
|
||||
var apikey = "0c4641686764e0ee56ef54b16fddc966";
|
||||
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 = "";
|
||||
Dictionary<string, string> map = new Dictionary<string, string>(){
|
||||
{"type",userinfo["type"].ToString() },
|
||||
{"user",userinfo["account"].ToString() },
|
||||
};
|
||||
|
||||
map = signAct(map);
|
||||
|
||||
var client = CreateHttpClient();
|
||||
var resp = await client.PostAsForm("https://jyip.net/open-api/kick-off-line", map);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
var status = jo["code"].ToString();
|
||||
|
||||
|
||||
try
|
||||
|
||||
if (status =="200")
|
||||
{
|
||||
|
||||
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 true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -363,7 +363,18 @@ namespace Hncore.Pass.Vpn.Service
|
||||
var product = await m_ProductService.GetById(productId);
|
||||
var agent = GetAgent(product);
|
||||
agent.Init(product.BaseUrl, product.Token);
|
||||
return await agent.OnLine(account);
|
||||
|
||||
if (productId == 28)
|
||||
{
|
||||
var accountInfo = await GetProductAccount(productId, account);
|
||||
if (accountInfo.PackageName.Contains("静态")){
|
||||
return await agent.OnLine(account+"-0");
|
||||
} else {
|
||||
return await agent.OnLine(account+"-1");
|
||||
}
|
||||
} else {
|
||||
return await agent.OnLine(account);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 踢号
|
||||
|
||||
Reference in New Issue
Block a user