types.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * 在 uniapp 的 RequestOptions 和 IUniUploadFileOptions 基础上,添加自定义参数
  3. */
  4. export type CustomRequestOptions = UniApp.RequestOptions & {
  5. query?: Record<string, any>
  6. /** 出错时是否隐藏错误提示 */
  7. hideErrorToast?: boolean
  8. /** 是否返回原始数据 add by panda 25.12.10 */
  9. original?: boolean
  10. } & IUniUploadFileOptions // 添加uni.uploadFile参数类型
  11. // 通用响应格式(兼容 msg + message 字段)
  12. export type IResponse<T = any> = {
  13. code: number
  14. data: T
  15. message: string
  16. [key: string]: any // 允许额外属性
  17. } | {
  18. code: number
  19. data: T
  20. msg: string
  21. [key: string]: any // 允许额外属性
  22. }
  23. /** 分页参数 */
  24. export interface PageParam {
  25. pageNo: number
  26. pageSize: number
  27. [key: string]: any // 允许额外属性
  28. }
  29. /** 分页结果 */
  30. export interface PageResult<T> {
  31. list: T[]
  32. total: number
  33. }
  34. /** 加载状态枚举 - 从 wot-design-uni 重新导出 */
  35. export type { LoadMoreState } from 'wot-design-uni/components/wd-loadmore/types'