页面超时跳转

This commit is contained in:
zhn
2022-06-10 17:00:43 +08:00
parent ba71b20da8
commit 5d67ac93ba
+5 -3
View File
@@ -24,7 +24,8 @@
import Vue from 'vue' import Vue from 'vue'
import {ACCESS_TOKEN} from '@/store/mutation-types' import {ACCESS_TOKEN} from '@/store/mutation-types'
import eventBUs from '../../common/event' import eventBUs from '../../common/event'
import {Modal} from 'ant-design-vue'
import store from '@/store'
export default { export default {
name: 'index', name: 'index',
props: { props: {
@@ -129,7 +130,8 @@
} else { } else {
let data = info.file.response let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN) const token = Vue.ls.get(ACCESS_TOKEN)
if (token && data.message.includes('Token失效')) { if ((token && data.message.includes('Token失效')) || (token && data.message.includes('token')) || (token && data.message.includes('用户不存在'))) {
this.spinning = false
Modal.error({ Modal.error({
title: '登录已过期', title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录', content: '很抱歉,登录已过期,请重新登录',
@@ -169,7 +171,7 @@
if (info.file.response.status === 500) { if (info.file.response.status === 500) {
let data = info.file.response let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN) const token = Vue.ls.get(ACCESS_TOKEN)
if (token && data.message.includes('Token失效')) { if ((token && data.message.includes('Token失效')) || (token && data.message.includes('token')) || (token && data.message.includes('用户不存在'))) {
Modal.error({ Modal.error({
title: '登录已过期', title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录', content: '很抱歉,登录已过期,请重新登录',