You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haoliang-net/frontend/mock/types.ts

19 lines
435 B
TypeScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* Mock 路由类型定义
* 替代 vite-plugin-mock 的 MockMethod 类型
*/
export interface MockRequest {
query: Record<string, string>
body: any
url: string
method: string
/** URL路径参数如 /brand/:id 中的 { id: '1' } */
params: Record<string, string>
}
export interface MockMethod {
url: string
method?: 'get' | 'post' | 'put' | 'delete' | 'patch'
response?: ((req: MockRequest) => any) | any
}