2023-08-04
This commit is contained in:
+35
-1
@@ -3,12 +3,15 @@ namespace BLL
|
||||
using MiniExcelLibs;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Quartz;
|
||||
using RestSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
@@ -33,7 +36,11 @@ namespace BLL
|
||||
return dataBaseLinkList;
|
||||
}
|
||||
}
|
||||
|
||||
public static IScheduler ScheduledTasks
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据库连接字符串
|
||||
@@ -1311,7 +1318,34 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
public static string RequestGet(string Baseurl, string Token)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
|
||||
var client = new RestClient(Baseurl);
|
||||
client.Timeout = -1;
|
||||
var request = new RestRequest(Method.GET);
|
||||
request.AddHeader("token", Token);
|
||||
IRestResponse response = client.Execute(request);
|
||||
Console.WriteLine(response.Content);
|
||||
return response.Content;
|
||||
}
|
||||
public static string RequestPost(string Baseurl, string Token, string JsonBody)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
|
||||
var client = new RestClient(Baseurl);
|
||||
client.Timeout = -1;
|
||||
var request = new RestRequest(Method.POST);
|
||||
request.AddHeader("token", Token);
|
||||
if (!string.IsNullOrEmpty(JsonBody))
|
||||
{
|
||||
request.AddJsonBody(JsonBody);
|
||||
}
|
||||
|
||||
IRestResponse response = client.Execute(request);
|
||||
return response.Content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user