ruoyi-plus-soybean/src/router/permission.ts

16 lines
327 B
TypeScript
Raw Normal View History

2021-08-17 14:59:59 +08:00
import type { Router } from 'vue-router';
/**
*
* @param router -
*/
export default function createRouterGuide(router: Router) {
router.beforeEach((to, from, next) => {
2021-08-18 12:02:59 +08:00
window.$loadingBar?.start();
2021-08-17 14:59:59 +08:00
next();
});
router.afterEach(() => {
2021-08-18 12:02:59 +08:00
window.$loadingBar?.finish();
2021-08-17 14:59:59 +08:00
});
}