Skip to content

切换 后端时 /logout 死循环 #7092

@kuchaguangjie

Description

@kuchaguangjie

从 mock api 切换到 自己的 api 时, 浏览器 死循环 调用 /logout, 直到浏览器崩溃.

原因: 因为切换了 api, 导致 token 无效, 从而 后端返回了 401, 而 401 将触发 /logout, 进入死循环.

解决方法: 在 logout() 函数中判断当前是否已进入 循环, 如果是, 则直接返回. 需要在外部加1个 boolean 标识.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions