mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-04-21 11:06:25 +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
|
* You can also judge the status by HTTP Status Code
|
||||||
*/
|
*/
|
||||||
response => {
|
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) => {
|
return new Promise((reslove, reject) => {
|
||||||
const res = response.data
|
const res = response.data
|
||||||
if (res.code !== 200) {
|
if (res.code !== 200) {
|
||||||
|
@ -99,7 +99,6 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.$store.dispatch('user/login', this.loginForm).then((res) => {
|
this.$store.dispatch('user/login', this.loginForm).then((res) => {
|
||||||
console.log(res)
|
|
||||||
this.$router.push({ path: '/dashboard' })
|
this.$router.push({ path: '/dashboard' })
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user