|
|
@ -1,5 +1,5 @@ |
|
|
import axios from 'axios' |
|
|
import axios from 'axios' |
|
|
import { Notification, MessageBox, Message, Loading, Dialog } from 'element-ui' |
|
|
|
|
|
|
|
|
import { Notification, MessageBox, Message, Loading } from 'element-ui' |
|
|
import store from '@/store' |
|
|
import store from '@/store' |
|
|
import { getToken } from '@/utils/auth' |
|
|
import { getToken } from '@/utils/auth' |
|
|
import errorCode from '@/utils/errorCode' |
|
|
import errorCode from '@/utils/errorCode' |
|
|
@ -133,13 +133,14 @@ service.interceptors.response.use( |
|
|
// })
|
|
|
// })
|
|
|
|
|
|
|
|
|
MessageBox.prompt( |
|
|
MessageBox.prompt( |
|
|
'登录状态已过期,您可以输入密码进入页面,或者取消', |
|
|
|
|
|
'提示', |
|
|
|
|
|
|
|
|
i18n.t('system.timeOutContent'), |
|
|
|
|
|
i18n.t('system.tip'), |
|
|
{ |
|
|
{ |
|
|
confirmButtonText: '进入页面', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
|
|
|
confirmButtonText: i18n.t('system.timeOutEnter'), |
|
|
|
|
|
cancelButtonText: i18n.t('form.cancel'), |
|
|
inputPattern: /^\S+$/, |
|
|
inputPattern: /^\S+$/, |
|
|
inputErrorMessage: '请输入密码', |
|
|
|
|
|
|
|
|
inputPlaceholder: i18n.t('login.password'), |
|
|
|
|
|
inputErrorMessage: i18n.t('login.password'), |
|
|
showClose: false, |
|
|
showClose: false, |
|
|
closeOnPressEscape: false, |
|
|
closeOnPressEscape: false, |
|
|
closeOnClickModal: false, |
|
|
closeOnClickModal: false, |
|
|
@ -221,7 +222,7 @@ service.interceptors.response.use( |
|
|
location.href = '/user/work' |
|
|
location.href = '/user/work' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') |
|
|
|
|
|
|
|
|
return Promise.reject(i18n.t('system.timeOutTip')) |
|
|
} else if (code === 500) { |
|
|
} else if (code === 500) { |
|
|
if (msg !== 'exists') { |
|
|
if (msg !== 'exists') { |
|
|
Message({ message: msg, type: 'error' }) |
|
|
Message({ message: msg, type: 'error' }) |
|
|
|