From 3a5d6662fbeb80426d9708a5d4684bdd5c1f072f Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Tue, 02 Aug 2022 17:37:00 +0800 Subject: [PATCH] 优化卡片外链,碎碎念标志 --- src/utils/request.js | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index b9e2a46..6413023 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -20,7 +20,6 @@ const err = (error) => { if (error.response) { - const data = error.response.data // const token = Vue.ls.get(ACCESS_TOKEN) if (error.response.status === 404) { @@ -38,8 +37,12 @@ }) } if (error.response.status === 500) { - if (data.message.length > 0) { - message.error(data.message) + if (data.message == undefined) { + message.error(error.response.data) + } else { + if (data.message.length > 0) { + message.error(data.message) + } } } if (error.response.status === 401 && !(data.result && data.result.isLogin)) { @@ -65,7 +68,7 @@ // if (token) { // config.headers['Authorization'] = 'Bearer ' + token // } - config.headers['Authorization'] = 'Bearer '; + // config.headers['Authorization'] = 'Bearer '; return config }, err) -- Gitblit v1.9.1