Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bug 修复鉴权时GetInfo与Logout双双失效导致路由死循环 #1231

Merged
merged 1 commit into from
Aug 17, 2021

Commits on Aug 17, 2021

  1. fix: bug 修复鉴权时GetInfo与Logout双双失效导致路由死循环

    在src/permission.js鉴权时有以下流程:
    1 store
    2 .dispatch('GetInfo')
    3 .catch(()=>{
    4   store.dispatch('Logout').then(()=>{
    5        next({ path: loginRoutePath, query: { redirect: to.fullPath } })
    6   })
    7 })
    2行GetInfo的失败catch会执行触发store的Logout(4行),而Logout也失败不catch会直接resolve导致路由到loginRoutePath(5行),
    loginRoutePath会再次加载src/permission.js运行store.dispatch('GetInfo'),从此死循环开始。。。
    sammeishi authored Aug 17, 2021
    Configuration menu
    Copy the full SHA
    1b885fc View commit details
    Browse the repository at this point in the history