You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
511 B

  1. import { createCURD } from '@/service/base.ts'
  2. import { RFormTypes } from '@/types/r-form/model'
  3. import request from '@/request.ts'
  4. const model = (api: string) => {
  5. return {
  6. ...createCURD<any, RFormTypes.IModel>(api),
  7. proxy: async <T = RFormTypes.IModelCURD>(params?: {
  8. path: string,
  9. body: any,
  10. method?: string
  11. }) => {
  12. return request.post<T>(`/x_form/proxy`, {
  13. api: `${api}/ui/curd`,
  14. method: 'post',
  15. ...params
  16. })
  17. }
  18. }
  19. }
  20. export { model }