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) => { router.beforeEach(async (to, from, next) => {
if (to.path.indexOf('/login') == -1) { if (to.path.indexOf('/login') == -1) {
sessionStorage.setItem(storageKey.tokenExpireCurrentPath, to.fullPath) sessionStorage.setItem(storageKey.tokenExpireCurrentPath, decodeURIComponent(to.fullPath))
} }
// 加载iso-3166-2资源 // 加载iso-3166-2资源
loadGeoData() loadGeoData()
@@ -50,13 +50,13 @@ router.beforeEach(async (to, from, next) => {
if (hasParam(to.fullPath, 'redirect')) { if (hasParam(to.fullPath, 'redirect')) {
next() next()
} else { } else {
next({ path: '/login', query: { redirect: tokenExpireCurrentPath } }) next({ path: '/login', query: { redirect: decodeURIComponent(tokenExpireCurrentPath) } })
} }
} else { } else {
next() next()
} }
} else { } else {
next({ path: '/login', query: { redirect: to.fullPath } }) next({ path: '/login', query: { redirect: decodeURIComponent(to.fullPath) } })
} }
} }
}) })