fix(router): 修复登录跳转时路径参数丢失的问题
使用新的fullPath变量保存原始路径,避免在拼接查询参数时修改原始path变量
This commit is contained in:
@@ -39,11 +39,12 @@ export const navigateToInterceptor = {
|
||||
console.log('命中了 LOGIN_PAGE_LIST')
|
||||
return
|
||||
}
|
||||
let fullPath = path
|
||||
|
||||
if (myQuery) {
|
||||
path += `?${Object.keys(myQuery).map(key => `${key}=${myQuery[key]}`).join('&')}`
|
||||
fullPath += `?${Object.keys(myQuery).map(key => `${key}=${myQuery[key]}`).join('&')}`
|
||||
}
|
||||
const redirectUrl = `${LOGIN_PAGE}?redirect=${encodeURIComponent(path)}`
|
||||
const redirectUrl = `${LOGIN_PAGE}?redirect=${encodeURIComponent(fullPath)}`
|
||||
|
||||
const tokenStore = useTokenStore()
|
||||
console.log('tokenStore.hasLogin:', tokenStore.hasLogin)
|
||||
|
||||
Reference in New Issue
Block a user