Merge pull request #6350 from dataease/pr@dev-v2@fix_cross_permission_by_url

fix: 非admin账号可以通过直接访问url方式访问系统设置页面
This commit is contained in:
fit2cloud-chenyw 2023-10-25 11:11:47 +08:00 committed by GitHub
commit dc09137d95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,11 @@ router.beforeEach(async (to, from, next) => {
return pre
}, {})
}
if (!pathValid(to.path) && to.path !== '/404' && !to.path.startsWith('/de-link')) {
const firstPath = getFirstAuthMenu()
next({ path: firstPath || '/404' })
return
}
next()
return
}