|
@@ -116,6 +116,11 @@ class Api {
|
|
|
if (i == arrLen - 1) {
|
|
|
newUrl += '/qq';
|
|
|
}
|
|
|
+
|
|
|
+ if (i == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
newUrl += '/';
|
|
|
newUrl += urlArr[i];
|
|
|
}
|
|
@@ -198,6 +203,14 @@ class Api {
|
|
|
if (res.statusCode === 200) {
|
|
|
let bodyStr = res.text();
|
|
|
let bodyObjct = JSON.parse(bodyStr);
|
|
|
+
|
|
|
+ if (bodyObjct == undefined) {
|
|
|
+ if (onFail != undefined) {
|
|
|
+ onFail(res.statusCode, '请求失败');
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
console.log('url :' + url, 'res: ' + res);
|
|
|
if (bodyObjct.code === ResponseStateCode.LOGIN_INVALIDATE) {
|
|
|
GameGlobal.needLogin = true;
|
|
@@ -212,7 +225,7 @@ class Api {
|
|
|
} else {
|
|
|
if (onFail != undefined) {
|
|
|
onFail(bodyObjct.code, bodyObjct.msg);
|
|
|
- GameGlobal.commonAlert.showCommonErrorAlert('url' + url + ' login error code: ' + errCode + 'login error msg: ' + errMsg);
|
|
|
+ // GameGlobal.commonAlert.showCommonErrorAlert('url' + url + ' login error code: ' + errCode + 'login error msg: ' + errMsg);
|
|
|
}
|
|
|
}
|
|
|
} else {
|