feat(projects): 1.0 beta

This commit is contained in:
Soybean
2023-11-17 08:45:00 +08:00
parent 1ea4817f6a
commit e918a2c0f5
499 changed files with 15918 additions and 24708 deletions

81
src/typings/api.d.ts vendored
View File

@@ -1,52 +1,39 @@
// 后端接口返回的数据类型
/**
* namespace Api
* @description all backend api type
*/
declare namespace Api {
/**
* namespace Auth
* @description backend api module: "auth"
*/
namespace Auth {
interface LoginToken {
token: string;
refreshToken: string;
}
/** 后端返回的用户权益相关类型 */
declare namespace ApiAuth {
/** 返回的token和刷新token */
interface Token {
token: string;
refreshToken: string;
interface UserInfo {
userId: string;
userName: string;
roles: string[];
}
}
/** 返回的用户信息 */
type UserInfo = Auth.UserInfo;
}
/** 后端返回的路由相关类型 */
declare namespace ApiRoute {
/** 后端返回的路由数据类型 */
interface Route {
/** 动态路由 */
routes: AuthRoute.Route[];
/** 路由首页对应的key */
home: AuthRoute.AllRouteKey;
}
}
declare namespace ApiUserManagement {
interface User {
/** 用户id */
id: string;
/** 用户名 */
userName: string | null;
/** 用户年龄 */
age: number | null;
/**
* 用户性别
* - 0: 女
* - 1: 男
*/
gender: '0' | '1' | null;
/** 用户手机号码 */
phone: string;
/** 用户邮箱 */
email: string | null;
/**
* 用户状态
* - 1: 启用
* - 2: 禁用
* - 3: 冻结
* - 4: 软删除
*/
userStatus: '1' | '2' | '3' | '4' | null;
/**
* namespace Route
* @description backend api module: "route"
*/
namespace Route {
type ElegantConstRoute = import('@elegant-router/types').ElegantConstRoute;
interface MenuRoute extends ElegantConstRoute {
id: string;
}
interface UserRoute {
routes: MenuRoute[];
home: import('@elegant-router/types').LastLevelRouteKey;
}
}
}