From f196f8d96eb2ffb2dff855118d70b3a33144ea45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E4=B8=9C=E6=97=AD?= <850374051@qq.com> Date: Tue, 20 Jun 2023 10:41:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E6=9D=83=E4=BA=A4=E6=98=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 37 ++++++++++++++------ src/views/sunVillage_info/list_signature.vue | 2 +- src/views/user/signature/signatureList.vue | 2 +- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 4f780619..65a7b305 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -61,6 +61,7 @@ service.interceptors.response.use(res => { const code = res.data.code || 200; // 获取错误信息 const msg = errorCode[code] || res.data.msg || errorCode['default'] + if (code === 401) { Dialog.confirm({ title: '系统提示', @@ -81,25 +82,41 @@ service.interceptors.response.use(res => { if (window.location.href.indexOf('/lawEnforcement') != -1) { window.location.href = '/lawEnforcement/login'; - } else if (window.location.href.indexOf('/authenticRight') != -1) { + return; + } + if (window.location.href.indexOf('/authenticRight') != -1) { window.location.href = '/authenticRight/login'; - } else if (window.location.href.indexOf('/homesteadSurvey') != -1) { + return; + } + if (window.location.href.indexOf('/homesteadSurvey') != -1) { window.location.href = '/homesteadLogin'; - } else if (window.location.href.indexOf('/onlineHome') != -1) { + return; + } + if (window.location.href.indexOf('/onlineHome') != -1) { window.location.href = '/zjdLogin'; - } else if (window.location.href.indexOf('/yinnong') != -1) { + return; + } + if (window.location.href.indexOf('/yinnong') != -1) { window.location.href = '/yinnongLogin'; - } else if (window.location.href.indexOf('/sunVillage_info/') != -1) { + return; + } + if (window.location.href.indexOf('/sunVillage_info/') != -1) { window.location.href = '/sunVillage_info/login'; - } else if (window.location.href.indexOf('/sunVillage') != -1) { + return; + } + if (window.location.href.indexOf('/sunVillage') != -1) { window.location.href = '/sunVillage/login'; - } else if (window.location.href.indexOf('/homestead/') != -1) { + return; + } + if (window.location.href.indexOf('/homestead/') != -1) { window.location.href = '/homestead/login'; - }else if (window.location.href.indexOf('/agriculturalTrusteeship') != -1){ + return; + } + if (window.location.href.indexOf('/agriculturalTrusteeship') != -1){ window.location.href = '/agriculturalTrusteeship/login'; - } else { - window.location.href = '/login'; + return; } + window.location.href = '/login'; }) }) } else if (code === 500) { diff --git a/src/views/sunVillage_info/list_signature.vue b/src/views/sunVillage_info/list_signature.vue index d39c16dc..50d4fe4a 100644 --- a/src/views/sunVillage_info/list_signature.vue +++ b/src/views/sunVillage_info/list_signature.vue @@ -45,7 +45,7 @@
预览