index.ts 727 B

123456789101112131415161718192021222324252627282930
  1. import * as booking from './module/booking'
  2. import * as tracking from './module/tracking'
  3. import * as common from './module/common'
  4. import * as login from './module/login'
  5. import * as other from './module/other'
  6. import * as notificationMessage from './module/notificationMessage'
  7. import * as system from './module/system'
  8. /**
  9. * api 对象接口定义
  10. */
  11. function generateApiMap(maps: any) {
  12. const methodMap: any = {}
  13. for (const key in maps) {
  14. methodMap[key] = maps[key]
  15. }
  16. return methodMap
  17. }
  18. const apis = generateApiMap({
  19. ...booking,
  20. ...tracking,
  21. ...common,
  22. ...login,
  23. ...other,
  24. ...notificationMessage,
  25. ...system
  26. })
  27. export default {
  28. ...apis // 取出所有可遍历属性赋值在新的对象上
  29. }