fix: 记录上次访问url前先使用decode解码

This commit is contained in:
chenjinsong
2022-09-09 15:17:50 +08:00
parent 53902cdda5
commit dea91e5ad1

View File

@@ -12,7 +12,7 @@ const permissionWhiteList = [...loginWhiteList, '/entityDetail'] // 权限白名
router.beforeEach(async (to, from, next) => {
if (to.path.indexOf('/login') == -1) {
sessionStorage.setItem(storageKey.tokenExpireCurrentPath, to.fullPath)
sessionStorage.setItem(storageKey.tokenExpireCurrentPath, decodeURIComponent(to.fullPath))
}
// 加载iso-3166-2资源
loadGeoData()
@@ -50,13 +50,13 @@ router.beforeEach(async (to, from, next) => {
if (hasParam(to.fullPath, 'redirect')) {
next()
} else {
next({ path: '/login', query: { redirect: tokenExpireCurrentPath } })
next({ path: '/login', query: { redirect: decodeURIComponent(tokenExpireCurrentPath) } })
}
} else {
next()
}
} else {
next({ path: '/login', query: { redirect: to.fullPath } })
next({ path: '/login', query: { redirect: decodeURIComponent(to.fullPath) } })
}
}
})