From a837a66f77f305124d6211e5072ca50eedf32066 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Sat, 13 Apr 2019 17:12:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dapi=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E8=BF=94=E5=9B=9E=E5=80=BC=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E8=BD=ACJSON=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Infrastructure/Extensions/HelperExtensions.cs | 2 +- projects/IoT/IoT.Shared/wwwroot/js/iot.js | 14 ++++++++++++++ .../APService/Properties/launchSettings.json | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/projects/Infrastructure/Extensions/HelperExtensions.cs b/projects/Infrastructure/Extensions/HelperExtensions.cs index c6f2ab4b..ff4e85b9 100644 --- a/projects/Infrastructure/Extensions/HelperExtensions.cs +++ b/projects/Infrastructure/Extensions/HelperExtensions.cs @@ -48,7 +48,7 @@ namespace Infrastructure.Extensions } } } - var ip = ipList.Where(o => o.ToString().StartsWith("192")).FirstOrDefault(); + var ip = ipList.Where(o => o.ToString().StartsWith("192.168.3")).FirstOrDefault(); return ip; } diff --git a/projects/IoT/IoT.Shared/wwwroot/js/iot.js b/projects/IoT/IoT.Shared/wwwroot/js/iot.js index 381adb20..594aee7a 100644 --- a/projects/IoT/IoT.Shared/wwwroot/js/iot.js +++ b/projects/IoT/IoT.Shared/wwwroot/js/iot.js @@ -303,6 +303,19 @@ function getJsonExt(url) { $.getJSON(url, function (result) { console.log(result); app.dialog.close(); + if (result.code === 0) { + if (result.type === 0) { + if (result.format === 1) { + console.log('format/1/base64 jpeg image'); + $('#callback .page-content .block').html(''); + } + else { + console.log('format/0/json object'); + $('#callback .page-content .block').html(result.data); + } + app.popup.open('#callback'); + } + } }).fail(function () { console.log('error'); app.dialog.close(); @@ -316,6 +329,7 @@ connection.on('Connected', function (id) { connectionId = id; }); connection.on('ApiResult', function (result) { + result = JSON.parse(result); if (result.code === 0) { if (result.type === 0) { if (result.format === 1) { diff --git a/projects/IoT/IoTServices/APService/Properties/launchSettings.json b/projects/IoT/IoTServices/APService/Properties/launchSettings.json index 2cc442a6..b4eff288 100644 --- a/projects/IoT/IoTServices/APService/Properties/launchSettings.json +++ b/projects/IoT/IoTServices/APService/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://127.0.0.1:8006", + "applicationUrl": "http://localhost:8006", "sslPort": 0 } }, @@ -18,7 +18,7 @@ "APService": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://127.0.0.1:8006", + "applicationUrl": "http://localhost:8006", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }