vbenjs / vue-vben-admin

A modern vue admin panel built with Vue3, Shadcn UI, Vite, TypeScript, and Monorepo. It's fast!
https://www.vben.pro
MIT License
24.46k stars 6.68k forks source link

当后端token过期后,这里死循环了 #3945

Closed gnyuan closed 2 months ago

gnyuan commented 3 months ago

有没有人遇到这个情况,当后端token过期后,这里死循环了。把后端token有效期设置为几秒,可以触发这个问题。

https://github.com/vbenjs/vue-vben-admin/blob/cec5c1128961e59363a9573d7360020a18737b6a/src/store/modules/user.ts#L98C18-L98C42

{555B67C7-3B3F-4648-B2A5-2084596A0966}

gnyuan commented 3 months ago

好像找到后端问题了,logout或者各类登录报错返回时,要传入{‘token’:'', 'userInfo': {}}让前端主动清空它的token?