index.ts 938 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import microRequest from '../../utils/micro_request';
  2. // 微服务
  3. const basePath = import.meta.env.VITE_ADMIN
  4. /**
  5. * API 层: 声明请求,使用 micro_request,不处理业务状态存储
  6. */
  7. // 登录接口
  8. export function useSystemApi() {
  9. return {
  10. // 查询系统参数
  11. getEntityMapByKeys(query?: object) {
  12. return microRequest.postRequest(basePath, 'Config', 'GetEntityMapByKeys', query)
  13. },
  14. // 根据字典类型获取字典项明细
  15. getDictDataByType(str: string) {
  16. return microRequest.postRequest(basePath, 'Dict', 'GetDictDataByType', { dictType: str })
  17. },
  18. // 获取通知列表
  19. getNoticeList(query?: object) {
  20. return microRequest.postRequest(basePath, 'Notice', 'GetList', query)
  21. },
  22. // 获取通知详情
  23. getNoticeDetail(id: number | string) {
  24. return microRequest.postRequest(basePath, 'Notice', 'GetEntityById', { id: Number(id) })
  25. }
  26. }
  27. }