mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-12-16 02:20:52 +08:00
30 lines
870 B
TypeScript
30 lines
870 B
TypeScript
import { Router, NavigationGuard } from 'vue-router';
|
|
import { Ref } from 'vue';
|
|
|
|
export const 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;
|
|
};
|
|
}
|
|
}
|