diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs index cebc0fe2..06462030 100644 --- a/SGGL/BLL/Common/CommonService.cs +++ b/SGGL/BLL/Common/CommonService.cs @@ -589,6 +589,7 @@ namespace BLL /// public static string CreateGetHttpResponse(string url) { + System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;//创建请求对象 request.Method = "Get";//请求方式 request.ContentType = "application/x-www-form-urlencoded";//链接类型 diff --git a/SGGL/WebAPI/Controllers/VideoController.cs b/SGGL/WebAPI/Controllers/VideoController.cs index 2038c568..10d009f5 100644 --- a/SGGL/WebAPI/Controllers/VideoController.cs +++ b/SGGL/WebAPI/Controllers/VideoController.cs @@ -24,7 +24,6 @@ namespace WebAPI.Controllers { string url =ConfigurationManager.AppSettings["Video_URL"]; var project = BLL.ProjectService.GetProjectByProjectId(projectId); - string URLToken = ""; String restoken = BLL.CommonService.CreateGetHttpResponse(url + "api/v1/login?username=" + project.ProjectCode + "&password=" + Funs.EncryptionPassword(project.MonitorPW)); Dictionary dicres = JsonConvert.DeserializeObject>(restoken); @@ -33,7 +32,6 @@ namespace WebAPI.Controllers responeData.data = data; List urls = new List(); string res = APIGetHttpService.Http(url + "api/v1/device/channeltree?token=" + URLToken); - var name = BLL.ProjectService.GetProjectNameByProjectId(projectId); List> jsonNvr = JsonConvert.DeserializeObject>>(res); foreach (Dictionary nvr in jsonNvr) {