添加401清除使用的数据
This commit is contained in:
@@ -4,7 +4,7 @@ import { useUserInfoStore } from '@/stores/modules/userInfo'
|
||||
const store = useUserInfoStore()
|
||||
import { getLocal } from '@/utils/local'
|
||||
import router from '@/router/index'
|
||||
import { useOverallStore } from '@/stores'
|
||||
import { useOverallStore, useGenerateStore } from '@/stores'
|
||||
|
||||
|
||||
// 创建axios实例
|
||||
@@ -98,8 +98,13 @@ service.interceptors.response.use(
|
||||
// location.reload() // 为了重新实例化vue-router对象 避免bug
|
||||
// })
|
||||
// })
|
||||
router.replace('/login')
|
||||
return Promise.reject(error)
|
||||
showToast({
|
||||
message: 'Please log in and try again.',
|
||||
duration: 5000
|
||||
})
|
||||
router.push('/welcome')
|
||||
useGenerateStore().clearGenerateData()
|
||||
return Promise.reject(false)
|
||||
}
|
||||
error.config && removePending(error.config)
|
||||
// 关闭loading
|
||||
|
||||
Reference in New Issue
Block a user