user.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * @Author: ChenYaJin
  3. * @Date: 2023-07-11 14:28:24
  4. * @LastEditors: ChenYaJin
  5. * @LastEditTime: 2023-11-09 09:57:44
  6. * @Description: 当前企业用户api
  7. */
  8. import { http } from '~/utils/fetch/index'
  9. import type { BasicResponse } from '~/models/common'
  10. import { Enterprise, type IEnterprise } from '~/models/enterprise'
  11. /**
  12. * 获取当前企业用户的详细信息
  13. * @returns
  14. */
  15. export function getEnterpriseUser() {
  16. return http.request<BasicResponse<Enterprise>>({
  17. url: '/enterprise/detail',
  18. method: 'get',
  19. })
  20. }
  21. /**
  22. * 填写当前企业用户信息
  23. * @param data Enterprise
  24. * @returns
  25. */
  26. export function postEnterpriseUser(data: IEnterprise) {
  27. return http.request<BasicResponse<number>>({
  28. url: `/enterprise`,
  29. method: 'post',
  30. data,
  31. })
  32. }
  33. /**
  34. * 修改当前企业用户信息
  35. * @param data Enterprise
  36. * @returns
  37. */
  38. export function putEnterpriseUser(id: string, data: IEnterprise) {
  39. return http.request<BasicResponse<number>>({
  40. url: `/enterprise/${id}`,
  41. method: 'put',
  42. data,
  43. })
  44. }