From 6ec8682e2ace0376e539a642353d110256e90f61 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期二, 06 八月 2024 15:54:34 +0800 Subject: [PATCH] 1 --- plugins/http.js | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-) diff --git a/plugins/http.js b/plugins/http.js index e2b5096..5c1987a 100644 --- a/plugins/http.js +++ b/plugins/http.js @@ -134,7 +134,7 @@ // store.dispatch('/clearUserInfo') // commit('updat') // store.commit('updateLogin', false) - console.log('401',res) + console.log('401', res) message.showToast('登录信息失效') storage.removeItem('token') reject({ @@ -160,6 +160,13 @@ code: 403, msg: 'Forbidden' }) + } else if (res.statusCode === 429) { + message.showToast('系统操作太频繁,请稍后再试!') + reject({ + data: null, + code: 429, + msg: 'Forbidden' + }) } else if (res.statusCode === 404) { message.showToast('api不存在') reject({ @@ -168,13 +175,20 @@ msg: 'Not Found' }) } else if (res.statusCode === 500) { - message.showToast('服务器内部错误') + message.showToast('服务更新升级中,请稍等一分钟左右') reject({ data: null, code: 500, - msg: 'Internal Server Error' + msg: '服务更新升级中,请稍等一分钟左右' }) - } else { + } else if (res.statusCode === 502) { + message.showToast('服务更新升级中,请稍等一分钟左右') + reject({ + data: null, + code: 502, + msg: '服务更新升级中,请稍等一分钟左右' + }) + }else { message.showToast('其他错误') reject({ data: null, -- Gitblit v1.9.3