Commit 864c00105dd3b8ecddaaa39fad619d7a652593a1
1 parent
4f6047af
Exists in
zfb_waibu_linshi
兼容2.x高版本的请求返回
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
wxsdk/http/SDKHttp.ts
@@ -39,6 +39,9 @@ export default class SDKHttp { | @@ -39,6 +39,9 @@ export default class SDKHttp { | ||
39 | if (xhr.status >= 200 && xhr.status < 400) { | 39 | if (xhr.status >= 200 && xhr.status < 400) { |
40 | let responseText: any = xhr.responseText; | 40 | let responseText: any = xhr.responseText; |
41 | // cc.log("responseText"+ responseText) | 41 | // cc.log("responseText"+ responseText) |
42 | + if(typeof responseText == "object") { | ||
43 | + responseText = JSON.stringify(responseText); | ||
44 | + } | ||
42 | try { | 45 | try { |
43 | responseText = JSON.parse(responseText); | 46 | responseText = JSON.parse(responseText); |
44 | // cc.log("responseText22", responseText) | 47 | // cc.log("responseText22", responseText) |