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.

index.js 922B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * 网络请求模块入口文件
  3. * 统一导出所有网络相关功能
  4. */
  5. // 导入核心请求工具
  6. import {
  7. NetworkRequest,
  8. request
  9. } from "./request"
  10. import {
  11. API,
  12. callAPI
  13. } from "./etcApi"
  14. /**
  15. * 默认导出便捷的请求对象
  16. * 包含最常用的功能
  17. */
  18. const networkModule = {
  19. // 基础请求方法
  20. post: request.post,
  21. get: request.get,
  22. // API分类调用
  23. api: API,
  24. // 通用调用
  25. call: callAPI,
  26. // 配置方法
  27. setTimeout: request.setTimeout,
  28. setBaseUrl: request.setBaseUrl,
  29. /**
  30. * 快速调用ETC相关接口
  31. */
  32. etc: API.ETC,
  33. /**
  34. * 快速调用通用接口
  35. */
  36. common: API.Common,
  37. /**
  38. * 快速调用支付接口
  39. */
  40. payment: API.Payment
  41. };
  42. // CommonJS 导出
  43. module.exports = networkModule;
  44. module.exports.NetworkRequest = NetworkRequest;
  45. module.exports.request = request;
  46. module.exports.API = API;
  47. module.exports.callAPI = callAPI;