From 264119a1422f264ac6a9acf67561bc631ff7d872 Mon Sep 17 00:00:00 2001 From: zclzone Date: Thu, 24 Nov 2022 21:05:42 +0800 Subject: [PATCH] fix: $message --- src/utils/http/interceptors.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/http/interceptors.js b/src/utils/http/interceptors.js index ef961a5..531109d 100644 --- a/src/utils/http/interceptors.js +++ b/src/utils/http/interceptors.js @@ -35,7 +35,7 @@ export function resResolve(response) { const message = resolveResError(code, data?.message ?? statusText) /** 需要错误提醒 */ - !config.noNeedTip && $message.error(message) + !config.noNeedTip && window.$message?.error(message) return Promise.reject({ code, message, error: data || response }) } return Promise.resolve(data) @@ -46,13 +46,13 @@ export function resReject(error) { const code = error?.code /** 根据code处理对应的操作,并返回处理后的message */ const message = resolveResError(code, error.message) - $message?.error(message) + window.$message?.error(message) return Promise.reject({ code, message, error }) } const { data, status, config } = error.response const code = data?.code ?? status const message = resolveResError(code, data?.message ?? error.message) /** 需要错误提醒 */ - !config?.noNeedTip && $message.error(message) + !config?.noNeedTip && window.$message?.error(message) return Promise.reject({ code, message, error: error.response?.data || error.response }) }