From ca150d38b8ecb9c69b0b32ac865e28fcf8c8fc8f Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期一, 28 十一月 2022 16:14:44 +0800 Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/sccg_ui --- src/http/interceptor-handler.js | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/http/interceptor-handler.js b/src/http/interceptor-handler.js index b3e2e32..6e85f1e 100644 --- a/src/http/interceptor-handler.js +++ b/src/http/interceptor-handler.js @@ -10,12 +10,17 @@ * @returns {Promise} */ export function handleResponseSuccess(response) { - debugger tryHideFullScreenLoading() urlRecorder.remove(response.config) - const result = response.data + let result = response.data - // return result.content + if (response.headers['content-disposition']) { + result = { + contentDisposition: response.headers['content-disposition'], + data: response.data + } + } + if (result.code === 200) { return result.data || result.content } else if (result.code && result.code !== 0) { @@ -74,15 +79,6 @@ */ export function handleError(requestConfig, result) { // 蹇呴』鏄疎rror瀵硅薄锛屽惁鍒檛hrow鏃秜uex瑕佹姤warning - // let err - // if (result instanceof Error) { - // err = result - // } else { - // err = new Error(result.msg) - // err.content = result.content - // err.code = result.code - // err.msg = result.msg - // } if (requestConfig && requestConfig.errorHandler) { result.url = requestConfig.url requestConfig.errorHandler(result) -- Gitblit v1.8.0