You can wrap the axios.patch call in a promise like this:

const myPromise = new Promise((resolve, reject) => {
  axios.patch(options.url, options.data, {
    headers: options.headers
  })
  .then(response => {
    resolve(response);
  })
  .catch(error => {
    reject(error);
  });
});

Then, you can use myPromise to handle the result of the axios.patch call:

myPromise.then(response => {
  // Handle success
}).catch(error => {
  // Handle error
});
const aquire = axiospatchoptionsurl optionsdata headers optionsheaders how to move this to into promise

原文地址: https://www.cveoy.top/t/topic/LY6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录