登录后返回原始页面功能

This commit is contained in:
honue
2024-03-05 15:20:27 +08:00
parent 73f11b920f
commit 14e776a287
3 changed files with 5 additions and 2 deletions

View File

@@ -77,8 +77,8 @@ function login() {
store.dispatch('auth/updateUserName', username)
store.dispatch('auth/updateAvatar', avatar)
// 跳转到首页
router.push('/')
// 跳转到首页或回原始页面
router.push(store.state.auth.originalPath)
})
.catch((error: any) => {
// 登录失败,显示错误提示