fix(plugin-access): 补充 RuntimeConfig['access'] 字段 (#205)

This commit is contained in:
izumiiAoba 2023-08-01 16:06:50 +08:00 committed by GitHub
parent 55e87e5d68
commit 61fa8be45e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import { Router, RouteLocationNormalized, NavigationGuardNext, NavigationGuardReturn, NavigationGuard } from 'vue-router'; import { Router, RouteLocationNormalized, NavigationGuardNext, NavigationGuard } from 'vue-router';
import { Ref } from 'vue'; import { Ref } from 'vue';
export const access: { export const access: {
@ -19,7 +19,7 @@ interface CustomNavigationGuardOption {
} }
interface CustomNavigationGuard { interface CustomNavigationGuard {
(option: CustomNavigationGuardOption): NavigationGuardReturn | Promise<NavigationGuardReturn>; (option: CustomNavigationGuardOption): ReturnType<NavigationGuard>;
} }
declare module '@fesjs/fes' { declare module '@fesjs/fes' {
@ -33,8 +33,9 @@ declare module '@fesjs/fes' {
interface PluginRuntimeConfig { interface PluginRuntimeConfig {
access?: { access?: {
noFoundHandler: NavigationGuard; noFoundHandler?: CustomNavigationGuard;
unAccessHandler: CustomNavigationGuard; unAccessHandler?: CustomNavigationGuard;
ignoreAccess?: string[];
}; };
} }
} }