duyuemuyuliqi:
有没有大佬参考这篇文章实现了功能的
我的需求是,打开网站默认进入登录页,登录接口返回权限信息(路由信息),然后将路由信息保存到localstorage,然后跳转到pathA/?redirect=pathB(pathA和pathB页面都使用了同一个layoutA.vue,其中pathA是写到router/index.js文件里的,pathB是登录后生成的路由),在layoutA.vue文件里这样写
onMounted(() => {
creatRoute()
if (redirectUrl.value){
router.replace(redirectUrl.value)
}
})
creatRoute()这个方法就是参考这篇文章的写法。
问题:登录后使用pathA/?redirect=pathB跳转,此时是没问题的,导航菜单正常显示,点击页面切换也没问题,但是刷新页面就不行了,F12里报错是main.js:15 [Vue Router warn]: No match found for location with path "/admin/admin_menu/index",请问大佬怎么解决???