jdk 17
This commit is contained in:
55
sdk/frontend/oauth2-login-sdk/dist/guards/router.d.ts
vendored
Normal file
55
sdk/frontend/oauth2-login-sdk/dist/guards/router.d.ts
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* 路由守卫模块
|
||||
* 提供基于权限的路由拦截和未登录自动跳转登录页功能
|
||||
*/
|
||||
import { Auth } from '../core/auth';
|
||||
/**
|
||||
* 路由守卫选项
|
||||
*/
|
||||
export interface RouterGuardOptions {
|
||||
/**
|
||||
* 是否需要登录
|
||||
*/
|
||||
requiresAuth?: boolean;
|
||||
/**
|
||||
* 需要的权限列表
|
||||
*/
|
||||
requiredPermissions?: string[];
|
||||
/**
|
||||
* 登录后重定向的URL
|
||||
*/
|
||||
redirectUri?: string;
|
||||
/**
|
||||
* 权限不足时重定向的URL
|
||||
*/
|
||||
unauthorizedRedirectUri?: string;
|
||||
}
|
||||
/**
|
||||
* 路由守卫类
|
||||
*/
|
||||
export declare class RouterGuard {
|
||||
private auth;
|
||||
/**
|
||||
* 构造函数
|
||||
* @param auth 认证实例
|
||||
*/
|
||||
constructor(auth: Auth);
|
||||
/**
|
||||
* 检查路由权限
|
||||
* @param options 路由守卫选项
|
||||
* @returns Promise<boolean> 是否通过权限检查
|
||||
*/
|
||||
check(options: RouterGuardOptions): Promise<boolean>;
|
||||
/**
|
||||
* 创建Vue路由守卫
|
||||
* @returns 路由守卫函数
|
||||
*/
|
||||
createVueGuard(): (to: any, from: any, next: any) => Promise<void>;
|
||||
/**
|
||||
* 检查当前用户是否有权限访问资源
|
||||
* @param permissions 需要的权限列表
|
||||
* @returns Promise<boolean> 是否拥有权限
|
||||
*/
|
||||
hasPermission(permissions: string | string[]): Promise<boolean>;
|
||||
}
|
||||
//# sourceMappingURL=router.d.ts.map
|
||||
Reference in New Issue
Block a user