From a8532e35b1a39de9bbcc5f2a648fe02c72d9c2b0 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期四, 16 二月 2023 14:09:53 +0800 Subject: [PATCH] Merge branch 'dev1.0' of http://42.193.1.25:9521/r/sccg_ui into dev1.0 --- src/http/interceptor-handler.js | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/http/interceptor-handler.js b/src/http/interceptor-handler.js index e42f04b..6e85f1e 100644 --- a/src/http/interceptor-handler.js +++ b/src/http/interceptor-handler.js @@ -12,9 +12,15 @@ export function handleResponseSuccess(response) { 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) { @@ -73,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