(to: RouteLocationRaw)
| 6 | import type { RouteLocationRaw } from 'vue-router'; |
| 7 | |
| 8 | const pushWithAccessCheck = async (to: RouteLocationRaw) => { |
| 9 | const resolvedRoute = router.resolve(to); |
| 10 | if (!hasRouteAccess(resolvedRoute)) { |
| 11 | MsgError(i18n.global.t('commons.res.forbidden')); |
| 12 | return; |
| 13 | } |
| 14 | await router.push(to); |
| 15 | tabStoreMiddleWare(); |
| 16 | }; |
| 17 | |
| 18 | export const routerToName = async (name: string) => { |
| 19 | await pushWithAccessCheck({ name: name }); |
no test coverage detected