index.ts 578 B

1234567891011121314151617181920212223242526
  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. /**
  7. * api 对象接口定义
  8. */
  9. function generateApiMap(maps: any) {
  10. const methodMap: any = {}
  11. for (const key in maps) {
  12. methodMap[key] = maps[key]
  13. }
  14. return methodMap
  15. }
  16. const apis = generateApiMap({
  17. ...booking,
  18. ...tracking,
  19. ...common,
  20. ...login,
  21. ...other
  22. })
  23. export default {
  24. ...apis // 取出所有可遍历属性赋值在新的对象上
  25. }