Commit 67d0ff0e251f584883d50fd71b2413b6ca94729d
1 parent
faf3f460
feat(setting): add openNProgress setting
Showing
4 changed files
with
11 additions
and
3 deletions
package.json
src/router/guard/index.ts
... | ... | @@ -6,9 +6,12 @@ import { createPageTitleGuard } from './pageTitleGuard'; |
6 | 6 | import { createProgressGuard } from './progressGuard'; |
7 | 7 | import { createPermissionGuard } from './permissionGuard'; |
8 | 8 | import { createPageLoadingGuard } from './pageLoadingGuard'; |
9 | +import { useSetting } from '/@/hooks/core/useSetting'; | |
9 | 10 | |
10 | -const axiosCanceler = new AxiosCanceler(); | |
11 | +const { projectSetting } = useSetting(); | |
11 | 12 | export function createGuard(router: Router) { |
13 | + const axiosCanceler = new AxiosCanceler(); | |
14 | + | |
12 | 15 | router.beforeEach(async () => { |
13 | 16 | try { |
14 | 17 | Modal.destroyAll(); |
... | ... | @@ -20,7 +23,7 @@ export function createGuard(router: Router) { |
20 | 23 | console.warn('basic guard error:' + error); |
21 | 24 | } |
22 | 25 | }); |
23 | - createProgressGuard(router); | |
26 | + projectSetting.openNProgress && createProgressGuard(router); | |
24 | 27 | createPermissionGuard(router); |
25 | 28 | createPageTitleGuard(router); |
26 | 29 | createPageLoadingGuard(router); | ... | ... |
src/settings/projectSetting.ts
src/types/config.d.ts