refactor(project): simplified part of the package, code optimization
This commit is contained in:
@@ -1,4 +1,2 @@
|
||||
export type * from './router';
|
||||
export type * from './ui';
|
||||
export type * from './user';
|
||||
export type * from '@vben-core/typings';
|
||||
|
@@ -1,13 +0,0 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import type { Component } from 'vue';
|
||||
|
||||
// 定义递归类型以将 RouteRecordRaw 的 component 属性更改为 string
|
||||
type RouteRecordStringComponent<T = string> = {
|
||||
children?: RouteRecordStringComponent<T>[];
|
||||
component: T;
|
||||
} & Omit<RouteRecordRaw, 'children' | 'component'>;
|
||||
|
||||
type ComponentRecordType = Record<string, () => Promise<Component>>;
|
||||
|
||||
export type { ComponentRecordType, RouteRecordStringComponent };
|
11
packages/types/src/ui.d.ts
vendored
11
packages/types/src/ui.d.ts
vendored
@@ -1,11 +0,0 @@
|
||||
interface SelectListItem {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface TabsItem {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export type { SelectListItem, TabsItem };
|
25
packages/types/src/user.d.ts
vendored
25
packages/types/src/user.d.ts
vendored
@@ -1,9 +1,7 @@
|
||||
import type { BasicUserInfo } from '@vben-core/typings';
|
||||
|
||||
/** 用户信息 */
|
||||
interface UserInfo {
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
avatar: string;
|
||||
interface UserInfo extends BasicUserInfo {
|
||||
/**
|
||||
* 用户描述
|
||||
*/
|
||||
@@ -12,26 +10,11 @@ interface UserInfo {
|
||||
* 首页地址
|
||||
*/
|
||||
homePath: string;
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
realName: string;
|
||||
/**
|
||||
* 用户角色信息
|
||||
*/
|
||||
roles: string[];
|
||||
|
||||
/**
|
||||
* accessToken
|
||||
*/
|
||||
token: string;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
userId: string;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
username: string;
|
||||
}
|
||||
|
||||
export type { UserInfo };
|
||||
|
Reference in New Issue
Block a user