We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
访问getInfo(), permmenu()这两个接口502时,会导致无限循环访问,导致页面卡死
async login(params: API.LoginParams) { try { const { data } = await login(params); this.setToken(data.token); return this.afterLogin(); } catch (error) { return Promise.reject(error); } }, /** 登录成功之后, 获取用户信息以及生成权限路由 */ async afterLogin() { try { const wsStore = useWsStore(); const [userInfo, { perms, menus }] = await Promise.all([getInfo(), permmenu()]); this.perms = perms; this.name = userInfo.name; this.avatar = userInfo.headImg; this.userInfo = userInfo; // 生成路由 const generatorResult = generatorDynamicRouter(menus); this.menus = generatorResult.menus.filter((item) => !item.meta?.hideInMenu); !wsStore.client && wsStore.initSocket(); return { menus, perms, userInfo }; } catch (error) { // return this.logout(); } },
猜测原因: afterLogin中的catch捕捉了错误,导致login()重无法捕捉错误
afterLogin
login()
The text was updated successfully, but these errors were encountered:
嗯 捕捉到的错误应该是要抛出的
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
访问getInfo(), permmenu()这两个接口502时,会导致无限循环访问,导致页面卡死
猜测原因:
afterLogin
中的catch捕捉了错误,导致login()
重无法捕捉错误The text was updated successfully, but these errors were encountered: