mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-17 17:26:38 +08:00
refactor(types): move Auth and Route namespaces to separate files and clean up api.d.ts
This commit is contained in:
parent
8439a60070
commit
d37ce04606
37
src/typings/api.d.ts
vendored
37
src/typings/api.d.ts
vendored
@ -47,41 +47,4 @@ declare namespace Api {
|
|||||||
status: EnableStatus | null;
|
status: EnableStatus | null;
|
||||||
} & T;
|
} & T;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* namespace Auth
|
|
||||||
*
|
|
||||||
* backend api module: "auth"
|
|
||||||
*/
|
|
||||||
namespace Auth {
|
|
||||||
interface LoginToken {
|
|
||||||
token: string;
|
|
||||||
refreshToken: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface UserInfo {
|
|
||||||
userId: string;
|
|
||||||
userName: string;
|
|
||||||
roles: string[];
|
|
||||||
buttons: string[];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* namespace Route
|
|
||||||
*
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
20
src/typings/api/auth.d.ts
vendored
Normal file
20
src/typings/api/auth.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
declare namespace Api {
|
||||||
|
/**
|
||||||
|
* namespace Auth
|
||||||
|
*
|
||||||
|
* backend api module: "auth"
|
||||||
|
*/
|
||||||
|
namespace Auth {
|
||||||
|
interface LoginToken {
|
||||||
|
token: string;
|
||||||
|
refreshToken: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UserInfo {
|
||||||
|
userId: string;
|
||||||
|
userName: string;
|
||||||
|
roles: string[];
|
||||||
|
buttons: string[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
19
src/typings/api/route.d.ts
vendored
Normal file
19
src/typings/api/route.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
declare namespace Api {
|
||||||
|
/**
|
||||||
|
* namespace Route
|
||||||
|
*
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user