From 7fdd463201e9d0893413e4c92d91bf465e95ae3e Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 23 Feb 2023 13:58:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AF=B7=E6=B1=82=20p?= =?UTF-8?q?rofile=20api=20=E8=BF=94=E5=9B=9E=20302=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/users.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/store/modules/users.js b/src/store/modules/users.js index 6d2a66467..884011317 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -94,6 +94,11 @@ const actions = { if (!response) { reject('Verification failed, please Login again.') } + if (typeof response !== 'object') { + // 后端 middleware 对 API 做了校验,这里返回可能是 302 重定向, response 为 string 类型 + resolve(response) + return + } commit('SET_PROFILE', response) resolve(response) }).catch(error => {