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

addRoutes后,我换一个账号登录权限不一样了,怎么删除之前添加的的路由? #2997

Closed
hankun8645 opened this issue Oct 17, 2019 · 2 comments

Comments

@hankun8645
Copy link

@hankun8645 hankun8645 commented Oct 17, 2019

Version

2.6.0

Reproduction link

https://jsfiddle.net/chrisvfritz/50wL7mdz/

Steps to reproduce

目前是判断权限生成可访问的路由后addRoutes进去。但是退出登录后换一个账号登录,然后又重新生成一次,之后addRoutes。
问题1:控制台会警告提示[vue-router] Duplicate named routes,就是有重复的路由add进去了。
问题2:可能存在,直接输入地址栏跳转到前一账号可访问的路由(目前是在输地址栏后跳转,整个单页应用会重新init一次,根据当前缓存的账号权限重新生成routes,此问题暂时好像不需要解决)

会不会有方法去删除已经添加的routes?我看过vue-router的文档没有写这个方法。

What is expected?

解决问题

What is actually happening?

问题没有解决


matcher方法并不生效

@hankun8645

This comment has been minimized.

Copy link
Author

@hankun8645 hankun8645 commented Oct 17, 2019

我的微信1005922744

@posva

This comment has been minimized.

Copy link
Member

@posva posva commented Oct 17, 2019

Duplicate of #1234

@posva posva marked this as a duplicate of #1234 Oct 17, 2019
@posva posva closed this Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.