mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-12-02 03:37:57 +08:00
30 lines
875 B
TypeScript
30 lines
875 B
TypeScript
import { Router, NavigationGuard } from 'vue-router';
|
|
import { Ref } from 'vue';
|
|
|
|
export function access(): {
|
|
hasAccess(accessId: string | number): Promise<boolean>;
|
|
isDataReady(): boolean;
|
|
setRole(roleId: string | Promise<string>): void;
|
|
setAccess(accessIds: Array<string | number> | Promise<Array<string | number>>): void;
|
|
getAccess(): string[];
|
|
};
|
|
|
|
export function useAccess(accessId: Array<string | number>): Ref<boolean>;
|
|
|
|
declare module '@fesjs/fes' {
|
|
interface PluginBuildConfig {
|
|
access?:
|
|
| {
|
|
rules: Record<string, []>;
|
|
}
|
|
| false;
|
|
}
|
|
|
|
interface PluginRuntimeConfig {
|
|
access?: {
|
|
noFoundHandler: (param: { router: Router } & NavigationGuard) => void;
|
|
unAccessHandler: (param: { router: Router } & NavigationGuard) => void;
|
|
};
|
|
}
|
|
}
|