/** * 路由拦截,通常也是登录拦截 * 可以设置路由白名单,或者黑名单,看业务需要选哪一个 * 我这里应为大部分都可以随便进入,所以使用黑名单 */ import type { Plugin } from "vue"; export type RouteInterceptorOptions = { /** * 登录页面路径 */ loginRoute: string; /** * 需要登录的页面路径列表 */ needLoginPages: string[]; /** * 判断是否已登录的函数 */ isLogged: () => boolean; }; /** * 登录检查器,如果未登录,则跳转到登录页 * @param config - 配置对象 * @param config.redirect - 重定向地址 * @param config.needConfirm - 是否需要确认弹窗 * @returns true 表示已登录,false 表示未登录 */ export declare function checkLoginAndRedirect({ redirect, needConfirm }?: { redirect?: string; needConfirm?: boolean | UniNamespace.ShowModalOptions; }): boolean; export declare const routeInterceptor: Plugin;