修复api同步调用返回值的字符串转JSON问题

TangShanKaiPing
wanggang 6 years ago
parent 75fbff9891
commit a837a66f77

@ -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; return ip;
} }

@ -303,6 +303,19 @@ function getJsonExt(url) {
$.getJSON(url, function (result) { $.getJSON(url, function (result) {
console.log(result); console.log(result);
app.dialog.close(); 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('<img class="shot" src="' + result.data + '">');
}
else {
console.log('format/0/json object');
$('#callback .page-content .block').html(result.data);
}
app.popup.open('#callback');
}
}
}).fail(function () { }).fail(function () {
console.log('error'); console.log('error');
app.dialog.close(); app.dialog.close();
@ -316,6 +329,7 @@ connection.on('Connected', function (id) {
connectionId = id; connectionId = id;
}); });
connection.on('ApiResult', function (result) { connection.on('ApiResult', function (result) {
result = JSON.parse(result);
if (result.code === 0) { if (result.code === 0) {
if (result.type === 0) { if (result.type === 0) {
if (result.format === 1) { if (result.format === 1) {

@ -3,7 +3,7 @@
"windowsAuthentication": false, "windowsAuthentication": false,
"anonymousAuthentication": true, "anonymousAuthentication": true,
"iisExpress": { "iisExpress": {
"applicationUrl": "http://127.0.0.1:8006", "applicationUrl": "http://localhost:8006",
"sslPort": 0 "sslPort": 0
} }
}, },
@ -18,7 +18,7 @@
"APService": { "APService": {
"commandName": "Project", "commandName": "Project",
"launchBrowser": true, "launchBrowser": true,
"applicationUrl": "http://127.0.0.1:8006", "applicationUrl": "http://localhost:8006",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }

Loading…
Cancel
Save