Explorar el Código

deal server data

zy_1995 hace 7 meses
padre
commit
2f899c14ec
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      assets/Script/CustomClass/WebDataCenter.js

+ 2 - 1
assets/Script/CustomClass/WebDataCenter.js

@@ -119,7 +119,8 @@ WebDataCenter = cc.Class({
         xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
         xhr.onreadystatechange = function () {
             if (xhr.readyState === 4 && (xhr.status >= 200 && xhr.status < 300)) {
-                let response = xhr.responseText;
+                let response = xhr.responseText.replace(/\s+/g, '');
+                cc.log("post data return responseText: ", response);
                 callback(JSON.parse(response));
             }
         };