|
@@ -2,14 +2,14 @@ import type { Router } from 'vue-router';
|
|
|
|
|
|
import { Modal, notification } from 'ant-design-vue';
|
|
|
import { AxiosCanceler } from '/@/utils/http/axios/axiosCancel';
|
|
|
-import { createPageTitleGuard } from './pageTitleGuard';
|
|
|
import { createProgressGuard } from './progressGuard';
|
|
|
import { createPermissionGuard } from './permissionGuard';
|
|
|
import { createPageLoadingGuard } from './pageLoadingGuard';
|
|
|
import { useSetting } from '/@/hooks/core/useSetting';
|
|
|
import { getIsOpenTab, setCurrentTo } from '/@/utils/helper/routeHelper';
|
|
|
+import { setTitle } from '/@/utils/browser';
|
|
|
|
|
|
-const { projectSetting } = useSetting();
|
|
|
+const { projectSetting, globSetting } = useSetting();
|
|
|
export function createGuard(router: Router) {
|
|
|
const { openNProgress, closeMessageOnSwitch, removeAllHttpPending } = projectSetting;
|
|
|
let axiosCanceler: AxiosCanceler | null;
|
|
@@ -33,8 +33,16 @@ export function createGuard(router: Router) {
|
|
|
setCurrentTo(to);
|
|
|
return true;
|
|
|
});
|
|
|
+
|
|
|
+ router.afterEach((to) => {
|
|
|
+ // change html title
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ setTitle(to.meta.title, globSetting.title);
|
|
|
+ }, 0);
|
|
|
+ });
|
|
|
+
|
|
|
openNProgress && createProgressGuard(router);
|
|
|
createPermissionGuard(router);
|
|
|
- createPageTitleGuard(router);
|
|
|
createPageLoadingGuard(router);
|
|
|
}
|