This commit is contained in:
duan
2024-10-11 18:25:51 +08:00
37 changed files with 1000 additions and 521 deletions

View File

@@ -78,7 +78,7 @@ function commonsProcess(showLoading, httpReqCallback){
// http响应码不正确
if(statusCode != 200){
isShowErrorToast = true
infoBox.showErrorToast('服务器异常')
infoBox.showToast('服务器异常')
return Promise.reject(bodyData) // 跳转到catch函数
}
@@ -105,14 +105,11 @@ function commonsProcess(showLoading, httpReqCallback){
return Promise.resolve({ bizData: bodyData.data, code: bodyData.code })
}).catch( res => {
reqFinishFunc(); // 请求完毕的动作
// 如果没有提示错误, 那么此处提示 异常。
if(!isShowErrorToast){
infoBox.showErrorToast(`请求网络异常`)
infoBox.showToast(`请求网络异常`)
}
return Promise.reject(res)
}).finally(() => { // finally 是 then结束后再执行, 此处不适用。 需要在请求完成后立马调用: reqFinishFunc()

View File

@@ -88,7 +88,7 @@ function commonsProcess(showLoading, httpReqCallback) {
// http响应码不正确
if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
isShowErrorToast = true
infoBox.showErrorToast(data.message || '服务器异常')
infoBox.showToast(data.message || '服务器异常')
return Promise.reject(bodyData) // 跳转到catch函数
}