user.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * @Author: wanglj 471442253@qq.com
  3. * @Date: 2023-07-19 13:42:40
  4. * @LastEditors: wanglj wanglijie@dashoo.cn
  5. * @LastEditTime: 2025-03-19 09:54:45
  6. * @Description: file content
  7. * @FilePath: \labsop_meno\frontend\packages\base\src\api\system\user.ts
  8. */
  9. import request from '/@/utils/micro_request'
  10. const basePath = import.meta.env.VITE_ADMIN
  11. const insrtPath = import.meta.env.VITE_INSTR_ADMIN
  12. // 日程管理
  13. export function useUserApi() {
  14. return {
  15. // 创建
  16. createUser(query?: object) {
  17. return request.postRequest(basePath, 'User', 'Create', query)
  18. },
  19. // 更新
  20. updateUser(query?: object) {
  21. return request.postRequest(basePath, 'User', 'UpdateById', query)
  22. },
  23. // 列表
  24. getUserList(query?: object) {
  25. return request.postRequest(basePath, 'User', 'GetList', query)
  26. },
  27. // 删除
  28. deleteUser(query?: object) {
  29. return request.postRequest(basePath, 'User', 'DeleteByIds', query)
  30. },
  31. // 详情
  32. getUserEntity(query?: object) {
  33. return request.postRequest(basePath, 'User', 'GetEntityById', query)
  34. },
  35. // 详情
  36. getUserInfo(query?: object) {
  37. return request.postRequest(basePath, 'User', 'GetUserInfo', query)
  38. },
  39. // 修改密码
  40. changePassword(query?: object) {
  41. return request.postRequest(basePath, 'User', 'ChangePassword', query)
  42. },
  43. // 重置密码
  44. resetPassword(query?: object) {
  45. return request.postRequest(basePath, 'User', 'ResetPassword', query)
  46. },
  47. // 更新状态
  48. setUserStatus(query?: object) {
  49. return request.postRequest(basePath, 'User', 'SetStatus', query)
  50. },
  51. // 根据用户名获取用户信息
  52. getUserByUserName(query?: object) {
  53. return request.postRequest(basePath, 'User', 'GetUserByUserName', query)
  54. },
  55. // 下载用户模板
  56. downloadTmpl(query?: object) {
  57. return request.postRequest(basePath, 'User', 'ExcelTemplate', query)
  58. },
  59. // 上传用户模板
  60. uploadTmpl(query?: object) {
  61. return request.postRequest(basePath, 'User', 'ExcelImport', query)
  62. },
  63. // 获取用户字典
  64. getUserDict(query?: object) {
  65. return request.postRequest(basePath, 'User', 'GetDictList', query);
  66. },
  67. // 首页注册
  68. indexRegister(query?: object) {
  69. return request.postRequest(basePath, 'System', 'Register', query)
  70. },
  71. // 用户审批
  72. registerUserApproval(query?: object) {
  73. return request.postRequest(basePath, 'User', 'RegisterUserApproval', query)
  74. },
  75. // 发送邮件重置密码
  76. sendResetPasswordEmail(query?: object) {
  77. return request.postRequest(basePath, 'User', 'SendResetPasswordEmail', query)
  78. },
  79. // 邮箱链接重置密码
  80. resetPasswordFromEmail(query?: object) {
  81. return request.postRequest(basePath, 'User', 'ResetPasswordFromEmail', query)
  82. },
  83. // 根据字典类型获取字典项明细
  84. getDictDataByType(str: string) {
  85. return request.postRequest(basePath, 'Dict', 'GetDictDataByType', { dictType: str });
  86. },
  87. // 个人中心获取用户基础信息
  88. getProfile(query?: object) {
  89. return request.postRequest(basePath, 'User', 'GetProfile', query)
  90. },
  91. // 个人中心更新用户信息
  92. updateProfile(query?: object) {
  93. return request.postRequest(basePath, 'User', 'UpdateProfile', query)
  94. },
  95. // 个人中心用户修改头像
  96. setAvatar(query?: object) {
  97. return request.postRequest(basePath, 'User', 'SetAvatar', query)
  98. },
  99. // 个人中心信用分
  100. getScore(query?: object) {
  101. return request.postRequest(insrtPath, 'TusBlacklist', 'MyScore', query)
  102. },
  103. // 用户类型
  104. getUserTypeList(query?: object) {
  105. return request.postRequest(basePath, 'UserType', 'GetUserTypeList', query)
  106. },
  107. // 用户类型
  108. getUserType10List(query?: object) {
  109. return request.postRequest(basePath, 'UserType', 'GetUserType10List', query)
  110. },
  111. //更新 微信信息
  112. updateUserWxInfo(query?: object) {
  113. return request.postRequest(basePath, 'User', 'UpdateWechatIdByUserId', query)
  114. },
  115. }
  116. }