裂变星小程序-25.03.04
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.

20 lines
379 B

  1. import api from './api.js'
  2. const fetch = (key, data = {}, transform = true, loadingTitle) => {
  3. return new Promise(resolve => {
  4. const callback = (res) => {
  5. if (!transform) {
  6. resolve(res)
  7. return
  8. }
  9. if (res.code == 200) {
  10. resolve(res.result)
  11. }
  12. }
  13. api(key, data, callback, loadingTitle)
  14. })
  15. }
  16. export default fetch