Skip to content

Commit 278cce5

Browse files
author
piexlMax(奇淼
committed
Merge branch 'refs/heads/main' into dev-281
2 parents 45acc43 + 84a3c3b commit 278cce5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Diff for: web/src/permission.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ router.beforeEach(async (to, from) => {
115115

116116
return {
117117
name: 'Login',
118-
query: { redirect: to.href }
118+
query: { redirect: to.fullPath }
119119
}
120120
}
121121

@@ -126,7 +126,7 @@ router.beforeEach(async (to, from) => {
126126
return {
127127
name: 'Login',
128128
query: {
129-
redirect: document.location.hash
129+
redirect: to.fullPath
130130
}
131131
}
132132
})

Diff for: web/src/pinia/modules/user.js

+5
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ export const useUserStore = defineStore('user', () => {
8787
router.addRoute(asyncRouter)
8888
})
8989

90+
if(router.currentRoute.value.query.redirect) {
91+
await router.replace(router.currentRoute.value.query.redirect)
92+
return true
93+
}
94+
9095
if (!router.hasRoute(userInfo.value.authority.defaultRouter)) {
9196
ElMessage.error('请联系管理员进行授权')
9297
} else {

0 commit comments

Comments
 (0)