Skip to content

Commit 4060c77

Browse files
fix fetchrequest sonar 异味
1 parent 042fb67 commit 4060c77

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/common/util/FetchRequest.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export var RequestJSONPPromise = {
104104
send: function (splitQuestUrl, callback, proxy) {
105105
var len = splitQuestUrl.length;
106106
if (len > 0) {
107+
return new Promise((resolve) => {
107108
var jsonpUserID = new Date().getTime();
108109
for (var i = 0; i < len; i++) {
109110
var url = splitQuestUrl[i];
@@ -119,13 +120,14 @@ export var RequestJSONPPromise = {
119120
url = decodeURIComponent(url);
120121
url = proxy + encodeURIComponent(url);
121122
}
122-
return fetchJsonp(url, {
123+
fetchJsonp(url, {
123124
jsonpCallbackFunction: callback,
124125
timeout: 30000
125126
}).then((result) => {
126-
return result.json();
127+
resolve(result.json());
127128
});
128129
}
130+
})
129131
}
130132
},
131133

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy