31 lines
759 B
TypeScript
31 lines
759 B
TypeScript
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'
|
|
|
|
export interface Base62Param {
|
|
/** 当前选中的 tab 标识 */
|
|
tab?: string
|
|
/** 当前页码 */
|
|
page?: number
|
|
/** 每页条数 */
|
|
pageSize?: number
|
|
/** 筛选条件 */
|
|
condition?: Record<string, unknown>
|
|
/** 侧边栏选中项标识 */
|
|
sider?: string
|
|
/** 搜索关键词 */
|
|
keyword?: string
|
|
}
|
|
|
|
export interface RequestOptions {
|
|
url?: string
|
|
method?: HttpMethod
|
|
params?: Record<string, unknown>
|
|
data?: unknown
|
|
}
|
|
|
|
export type RequestFn = (
|
|
config: RequestOptions & Record<string, unknown>
|
|
) => Promise<{ code: number; msg: string; data: unknown; res?: string }>
|
|
|
|
/** [code, msg, data, url, res] */
|
|
export type CacheEntry = [number, string, unknown, string, string]
|