diff --git a/commons/utils/hasPermission.js b/commons/utils/hasPermission.js index 8372d7c..9277ffe 100644 --- a/commons/utils/hasPermission.js +++ b/commons/utils/hasPermission.js @@ -143,6 +143,7 @@ export async function hasPermission(params) { if(loginType=='0'){ return true } + return true; params = returnFormatParams(params) if (!params) { return infoBox.showToast('未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加') diff --git a/commons/utils/infoBox.js b/commons/utils/infoBox.js index 6b57f3f..b3ab4ed 100644 --- a/commons/utils/infoBox.js +++ b/commons/utils/infoBox.js @@ -25,7 +25,7 @@ const model = { // error类型的提示 showErrorToast: (title, duration) => { - return model.showToast(title, duration, {icon: 'error'}) + return model.showToast(title, duration, {icon: 'none'}) }, showLoading: (title = '请稍后' ) => { diff --git a/http/yskApi/http.js b/http/yskApi/http.js index 99e8cac..cc84443 100644 --- a/http/yskApi/http.js +++ b/http/yskApi/http.js @@ -92,7 +92,6 @@ function commonsProcess(showLoading, httpReqCallback) { return Promise.reject(bodyData); // 跳转到catch函数 } - // http响应码不正确 if (statusCode != 200 && statusCode != 204 && statusCode != 201) { isShowErrorToast = true; @@ -101,19 +100,25 @@ function commonsProcess(showLoading, httpReqCallback) { infoBox.showToast(data.message || "服务器异常"); return Promise.reject(bodyData); // 跳转到catch函数 } + // 构造请求成功的响应数据 if (bodyData.code == 501) { return Promise.reject(bodyData); // 跳转到catch函数 } + if(data.code!==200){ + return Promise.reject(bodyData); // 跳转到catch函数 + } if (data.code == 200 && data.data === null) { return Promise.resolve(true); } + return Promise.resolve(bodyData.data); }) .catch((res) => { + console.log('res', res); if (res.code == 401 || res.code == 501) { storageManage.token(null, true); - infoBox.showErrorToast(res.message || "请登录").then(() => { + infoBox.showErrorToast(res.message || res.msg || "请登录").then(() => { uni.redirectTo({ url: "/pages/login/index", }); @@ -122,16 +127,12 @@ function commonsProcess(showLoading, httpReqCallback) { } if (res.status == 500) { - infoBox.showErrorToast(res.message || "服务器异常").then(() => {}); + infoBox.showErrorToast(res.message ||res.msg || "服务器异常").then(() => {}); } + infoBox.showErrorToast(res.message||res.msg || "服务器异常").then(() => {}); reqFinishFunc(); // 请求完毕的动作 - // 如果没有提示错误, 那么此处提示 异常。 - if (!isShowErrorToast) { - infoBox.showErrorToast(`请求网络异常`); - } - return Promise.reject(res); }) .finally(() => { diff --git a/pagesCreateOrder/index/components/car.vue b/pagesCreateOrder/index/components/car.vue index 037c98f..dbcdb1c 100644 --- a/pagesCreateOrder/index/components/car.vue +++ b/pagesCreateOrder/index/components/car.vue @@ -94,7 +94,7 @@ {{ item.number }} -