请求返回修改
This commit is contained in:
15
http/http.js
15
http/http.js
@@ -92,7 +92,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||
infoBox.showToast(data.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 加密数据
|
||||
if (!bodyData.data && bodyData.encryptData) {
|
||||
return Promise.resolve({
|
||||
@@ -100,9 +100,18 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||
code: bodyData.code,
|
||||
});
|
||||
}
|
||||
|
||||
let result=null;
|
||||
if(bodyData.hasOwnProperty('data')){
|
||||
result=bodyData.data
|
||||
}
|
||||
else if(bodyData.hasOwnProperty('page')){
|
||||
result=bodyData.page
|
||||
}
|
||||
else{
|
||||
result=bodyData
|
||||
}
|
||||
// 构造请求成功的响应数据
|
||||
return Promise.resolve(bodyData.data || bodyData.page || bodyData);
|
||||
return Promise.resolve(result);
|
||||
})
|
||||
.catch((res) => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user