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('无效的会话,或者会话已过期,请重新登录。')