fix:修复登录过期不自动退出逻辑

This commit is contained in:
wangsongsole 2022-10-17 16:59:52 +08:00
parent 1e5a0b7b0b
commit 16016b9248
3 changed files with 29 additions and 12 deletions

View File

@ -346,15 +346,21 @@
}
if (this.isLogin) {
/*跳转起始页面*/
this.delayedOut()
}
},
/* 延时自动退出 */
delayedOut (time = 1) {
let entryLink = localStorage.getItem('entryLink');
setTimeout(() => {
window.location.replace(entryLink);
}, 3000);
}
}, time * 1000);
},
//兑换商品
exchangeGoodsFn () {
if (this.goodsDetail.type === 1) { /* 兑换码 */
@ -433,6 +439,7 @@
} else {
this.openErrorDialog(res.message);
if (res.code == 403) {
this.delayedOut(3)
this.isLogin = true
}
}

View File

@ -156,11 +156,16 @@
/* 重定向 */
backFunction () {
if (this.redirect) {
this.delayedOut()
}
},
/* 延时自动退出 */
delayedOut (time = 1) {
let entryLink = localStorage.getItem('entryLink');
setTimeout(() => {
window.location.replace(entryLink);
}, 1000);
}
}, time * 1000);
},
/* 请求数据 */
@ -179,7 +184,9 @@
this.popText = message
this.popStatus = 2
this.popShow = true
return this.redirect = true
this.redirect = true
this.delayedOut(3)
return
}
if (code === 200) {
const productArray = []

View File

@ -208,6 +208,7 @@
req.axiosPut(`/key/order/setPayType/${this.activeOrder.order_number}/${this.active}`).then(({ code, message }) => {
if (code === 403) {
this.popFunction({ title: '温馨提示', text: message, status: 2, b_text: '我知道了', show: true })
this.toPage(3)
return this.redirect = true
}
@ -226,6 +227,7 @@
req.axiosGet(`/key/coupon/createPay/${this.activeOrder.order_number}`).then(({ code, data, message }) => {
if (code === 403) {
this.popFunction({ title: '温馨提示', text: message, status: 2, b_text: '我知道了', show: true })
this.toPage(3)
return this.redirect = true
}
@ -260,6 +262,7 @@
req.axiosGet(`/key/order/${token}`, { page: this.page, limit: this.limit }).then(({ data, code, message }) => {
if (code === 403) {
this.popFunction({ title: '温馨提示', text: message, status: 2, b_text: '我知道了', show: true })
this.toPage(3)
return this.redirect = true
}
if (code === 200) {
@ -272,11 +275,11 @@
},
/*跳转起始页面*/
toPage () {
toPage (time = 1) {
let entryLink = localStorage.getItem('entryLink');
setTimeout(() => {
window.location.replace(entryLink);
}, 1000);
}, time * 1000);
},
/* 弹窗回调 */