From 1a61525947d43fd7c8a6df637bf5c1c8f9cc37f3 Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期四, 26 六月 2025 14:24:32 +0800 Subject: [PATCH] Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory --- culture/src/utils/request.js | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/culture/src/utils/request.js b/culture/src/utils/request.js index 31320ed..5c2a201 100644 --- a/culture/src/utils/request.js +++ b/culture/src/utils/request.js @@ -63,23 +63,32 @@ } } - console.log('rewdsada',res); - + console.log('rewdsada', res); + + if (res.data.code == 500) { + Message({ + message: res.data.msg || '服务器错误', + type: 'error', + duration: 2000 + }) + return + } + if (res.data.code == 200) { if (!res.data) { return Promise.resolve({}) } - if (res.data&&res.data.data&&res.data.data.code == 200) { + if (res.data && res.data.data && res.data.data.code == 200) { return Promise.resolve(res.data.data || res.data) - } else if ((res.data&&res.data.data&&(res.data.data.code == 103 || res.data.data.code == 401))) { + } else if ((res.data && res.data.data && (res.data.data.code == 103 || res.data.data.code == 401))) { Message({ message: res.data.data.msg || '登录已过期,请重新登录', type: 'warning', duration: 2000 }) - } else if ((res.data&&res.data.data&&(res.data.data.code == 500))) { + } else if ((res.data && res.data.data && (res.data.data.code == 500)) || res.data.code == 500) { Message({ message: res.data.data.msg || '服务器错误', type: 'error', -- Gitblit v1.7.1