From 16bd837711773dfc3761656d304f4520633fcfa2 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Thu, 17 Apr 2025 10:55:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index e4cb091f..91bc5cd6 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -7,6 +7,8 @@ import { tansParams, blobValidate } from '@/utils/bonus' import cache from '@/plugins/cache' import { saveAs } from 'file-saver' import { decryptWithSM4, encryptWithSM4, hashWithSM3AndSalt } from '@/utils/sm' +import router from '@/router' + const systemConfig = JSON.parse(localStorage.getItem('systemConfig')) || { requestConfig: { encryptRequest: false, checkIntegrity: false, encryptResponse: false } }; @@ -123,9 +125,9 @@ service.interceptors.response.use(res => { } else { this.$store.dispatch('LogOut').then(() => { // location.href = '/login' - this.$router.push('/login') + router.push('/login') }).catch(() => { - this.$router.push('/login') + router.push('/login') }) } return Promise.reject('无效的会话,或者会话已过期,请重新登录。')