小程序接口
This commit is contained in:
parent
b1628fdf4a
commit
00038e4ff0
|
@ -589,6 +589,7 @@ namespace BLL
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string CreateGetHttpResponse(string url)
|
public static string CreateGetHttpResponse(string url)
|
||||||
{
|
{
|
||||||
|
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||||
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;//创建请求对象
|
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;//创建请求对象
|
||||||
request.Method = "Get";//请求方式
|
request.Method = "Get";//请求方式
|
||||||
request.ContentType = "application/x-www-form-urlencoded";//链接类型
|
request.ContentType = "application/x-www-form-urlencoded";//链接类型
|
||||||
|
|
|
@ -24,7 +24,6 @@ namespace WebAPI.Controllers
|
||||||
{
|
{
|
||||||
string url =ConfigurationManager.AppSettings["Video_URL"];
|
string url =ConfigurationManager.AppSettings["Video_URL"];
|
||||||
var project = BLL.ProjectService.GetProjectByProjectId(projectId);
|
var project = BLL.ProjectService.GetProjectByProjectId(projectId);
|
||||||
|
|
||||||
string URLToken = "";
|
string URLToken = "";
|
||||||
String restoken = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/login?username=" + project.ProjectCode + "&password=" + Funs.EncryptionPassword(project.MonitorPW));
|
String restoken = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/login?username=" + project.ProjectCode + "&password=" + Funs.EncryptionPassword(project.MonitorPW));
|
||||||
Dictionary<string, string> dicres = JsonConvert.DeserializeObject<Dictionary<string, string>>(restoken);
|
Dictionary<string, string> dicres = JsonConvert.DeserializeObject<Dictionary<string, string>>(restoken);
|
||||||
|
@ -33,7 +32,6 @@ namespace WebAPI.Controllers
|
||||||
responeData.data = data;
|
responeData.data = data;
|
||||||
List<string> urls = new List<string>();
|
List<string> urls = new List<string>();
|
||||||
string res = APIGetHttpService.Http(url + "api/v1/device/channeltree?token=" + URLToken);
|
string res = APIGetHttpService.Http(url + "api/v1/device/channeltree?token=" + URLToken);
|
||||||
var name = BLL.ProjectService.GetProjectNameByProjectId(projectId);
|
|
||||||
List<Dictionary<string, string>> jsonNvr = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(res);
|
List<Dictionary<string, string>> jsonNvr = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(res);
|
||||||
foreach (Dictionary<string, string> nvr in jsonNvr)
|
foreach (Dictionary<string, string> nvr in jsonNvr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue