From 864c00105dd3b8ecddaaa39fad619d7a652593a1 Mon Sep 17 00:00:00 2001 From: 宋庆平 Date: Wed, 24 Jul 2024 17:55:23 +0800 Subject: [PATCH] 兼容2.x高版本的请求返回 --- wxsdk/http/SDKHttp.ts | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/wxsdk/http/SDKHttp.ts b/wxsdk/http/SDKHttp.ts index f4b57d3..f09974e 100644 --- a/wxsdk/http/SDKHttp.ts +++ b/wxsdk/http/SDKHttp.ts @@ -39,6 +39,9 @@ export default class SDKHttp { if (xhr.status >= 200 && xhr.status < 400) { let responseText: any = xhr.responseText; // cc.log("responseText"+ responseText) + if(typeof responseText == "object") { + responseText = JSON.stringify(responseText); + } try { responseText = JSON.parse(responseText); // cc.log("responseText22", responseText) -- libgit2 0.21.0