增加令牌自动续期功能

This commit is contained in:
pixel
2020-08-17 14:04:02 +08:00
parent 9679616935
commit 0239f7b97c
7 changed files with 62 additions and 55 deletions

View File

@@ -7,14 +7,6 @@ const whiteList = ['login', 'register']
router.beforeEach(async(to, from, next) => {
const token = store.getters['user/token']
// if (token) {
// const expiresAt = store.getters['user/expiresAt']
// const nowUnix = new Date().getTime()
// const hasExpires = (expiresAt - nowUnix) < 0
// if (hasExpires) {
// store.dispatch['user/claerAll']
// }
// }
// 在白名单中的判断情况
if (whiteList.indexOf(to.name) > -1) {
if (token) {