From 85841ef9441aff46d80c7458c928e085e78911a1 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期五, 01 四月 2022 14:43:10 +0800 Subject: [PATCH] 订单管理 --- src/scripts/httpRequest.ts | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/scripts/httpRequest.ts b/src/scripts/httpRequest.ts index 8ac414b..5fac11d 100644 --- a/src/scripts/httpRequest.ts +++ b/src/scripts/httpRequest.ts @@ -78,7 +78,10 @@ // window.sessionStorage.setItem('policeCameravideoIsLoginTimeout', JSON.stringify(true)) // } + return res.data ? res.data : {} + + /* //return res.data ? res.data : {}; */ }, @@ -157,16 +160,23 @@ } else { errJson.message = '杩炴帴鏈嶅姟鍣ㄥけ璐�!' - Notification({ - title: '', - showClose: true, - message: '杩炴帴鏈嶅姟鍣ㄥけ璐�!', - type: 'error' - }) + // router.push({ // path: '/login' // }); } + console.log(error.response); + + if(error.response&&error.response.data&&!error.response.data.success ) { + errJson.message =error.response.data.msg + } + + Notification({ + title: '閿欒', + showClose: true, + message:errJson.message, + type: 'error' + }) // 杩斿洖 response 閲岀殑閿欒淇℃伅 return Promise.reject(errJson) } -- Gitblit v1.8.0