mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-02-22 02:32:49 +08:00
修复凭证已过期 刷新页面无法重新登录问题
This commit is contained in:
parent
a0590ada4e
commit
360b8a5126
@ -44,6 +44,11 @@ service.interceptors.response.use(
|
||||
* You can also judge the status by HTTP Status Code
|
||||
*/
|
||||
response => {
|
||||
if (response.config.url.indexOf('user/info') !== -1 && response.data.code === 402) {
|
||||
store.dispatch('user/logout').then(() => {
|
||||
location.reload()
|
||||
})
|
||||
}
|
||||
return new Promise((reslove, reject) => {
|
||||
const res = response.data
|
||||
if (res.code !== 200) {
|
||||
|
@ -99,7 +99,6 @@ export default {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
this.$store.dispatch('user/login', this.loginForm).then((res) => {
|
||||
console.log(res)
|
||||
this.$router.push({ path: '/dashboard' })
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user