feat: 登录和用户接口typescript类型声明

This commit is contained in:
郝先瑞
2022-03-12 00:18:21 +08:00
parent 7d46ff1224
commit 27bbd35057
8 changed files with 415 additions and 393 deletions

11
src/types/api/base.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
export interface Page {
pageNum: number,
pageSize: number
}
export interface PageResult<T> {
data: T,
total: number
}

18
src/types/api/login.d.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
/**
* 登录请求参数
*/
export interface LoginRequestParam {
username: string,
password: string,
grant_type: string,
code: string,
uuid: string,
}
/**
* 登录响应参数
*/
export interface LoginResponseData {
access_token: string,
token_type: string
}

20
src/types/api/user.d.ts vendored Normal file
View File

@@ -0,0 +1,20 @@
import { Page, PageResult } from "./base"
/**
* 用户信息
*/
export interface UserInfo {
nickname: string,
avatar: string,
roles: string[],
perms: string[]
}
/**
* 用户查询参数
*/
export interface UserQueryParam extends Page {
keywords: String | undefined,
status: number | undefined ,
deptId: number | undefined
}

2
src/types/index.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './api/login'
export * from './api/user'