Skip to content

Commit c5ce8e2

Browse files
author
hezhentao
committed
2 parents 981e842 + 729c1bc commit c5ce8e2

File tree

10 files changed

+1819
-381
lines changed

10 files changed

+1819
-381
lines changed

src/service/baseserver/CommonServiceBase.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,20 @@ class CommonServiceBase {
239239
withCredentials: options.withCredentials,
240240
timeout: options.async ? 0 : null,
241241
proxy: options.proxy
242-
}).then(function (response) {
242+
})
243+
.then(function (response) {
243244
if (response.text) {
244245
return response.text();
245246
}
246247
return response.json();
247-
}).then(function (text) {
248+
})
249+
.catch(function(error) {
250+
let result = {error: true, value: {}};
251+
var failure = (options.scope) ? bind(options.failure, options.scope) : options.failure;
252+
failure(result);
253+
})
254+
.then(function (text) {
255+
if (!text) return;
248256
var result = null;
249257
if (typeof text === "string" && (text.toLowerCase() === 'true' || text.toLowerCase() === 'false')) {
250258
result = {};

src/service/baseserver/FetchRequest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ var FetchRequest = Zondy.FetchRequest = {
156156
timeout: RequestTimeout
157157
}).then(function (response) {
158158
return response;
159+
}).catch(function(error){
160+
return error;
159161
});
160162
},
161163

src/service/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"author": "mapgis",
1010
"license": "Apache2",
1111
"dependencies": {
12+
"@turf/turf": "^6.3.0",
1213
"fast-xml-parser": "^3.17.6",
1314
"qs": "^6.9.4"
1415
}

0 commit comments

Comments
 (0)