修复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;
}

@ -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('<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 () {
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) {

@ -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"
}

Loading…
Cancel
Save