Merge pull request #180 from sunhao1256/main

fix(projects): not only `/login` claim dynamic path scenario
This commit is contained in:
Soybean 2023-02-14 12:11:44 +08:00 committed by GitHub
commit 960b436c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -28,11 +28,11 @@ declare namespace AuthRoute {
type RouteComponentType = 'basic' | 'blank' | 'multi' | 'self'; type RouteComponentType = 'basic' | 'blank' | 'multi' | 'self';
/** 路由描述 */ /** 路由描述 */
interface RouteMeta { interface RouteMeta<K extends AuthRoute.RoutePath> {
/** 路由标题(可用来作document.title或者菜单的名称) */ /** 路由标题(可用来作document.title或者菜单的名称) */
title: string; title: string;
/** 路由的动态路径(需要动态路径的页面需要将path添加进范型参数) */ /** 路由的动态路径(需要动态路径的页面需要将path添加进范型参数) */
dynamicPath?: AuthRouteUtils.GetDynamicPath<'/login'>; dynamicPath?: AuthRouteUtils.GetDynamicPath<K>;
/** 作为单级路由的父级路由布局组件 */ /** 作为单级路由的父级路由布局组件 */
singleLayout?: Extract<RouteComponentType, 'basic' | 'blank'>; singleLayout?: Extract<RouteComponentType, 'basic' | 'blank'>;
/** 需要登录权限 */ /** 需要登录权限 */
@ -83,7 +83,7 @@ declare namespace AuthRoute {
/** 子路由 */ /** 子路由 */
children?: Route[]; children?: Route[];
/** 路由描述 */ /** 路由描述 */
meta: RouteMeta; meta: RouteMeta<RoutePath<K>>;
} & Omit<import('vue-router').RouteRecordRaw, 'name' | 'path' | 'redirect' | 'component' | 'children' | 'meta'> } & Omit<import('vue-router').RouteRecordRaw, 'name' | 'path' | 'redirect' | 'component' | 'children' | 'meta'>
: never; : never;

View File

@ -1,5 +1,5 @@
import 'vue-router'; import 'vue-router';
declare module 'vue-router' { declare module 'vue-router' {
interface RouteMeta extends AuthRoute.RouteMeta {} interface RouteMeta extends AuthRoute.RouteMeta<AuthRoute.RoutePath> {}
} }