解决不存在页面404跳转空白Bug

This commit is contained in:
Dimple 2019-11-11 16:18:10 +08:00
parent bcee37b84b
commit 15613e57ef

View File

@ -23,6 +23,8 @@ router.beforeEach((to, from, next) => {
// 拉取user_info
const roles = res.roles
store.dispatch('GenerateRoutes', { roles }).then(accessRoutes => {
//添加404跳转
accessRoutes.push({path: '*', redirect: '/404', hidden: true})
// 测试 默认静态页面
// store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
// 根据roles权限生成可访问的路由表