2
在VueJS中重試失敗的AJAX請求的最佳方式是什麼?在vuejs中重試失敗的Ajax請求
bulkDecline(requests, decliner) {
requests = _.map(requests, 'id');
return Vue.http.post(`${baseUrl}/api/decline/${decliner}/bulk-decline`, requests)
.then(
(response) => {
Notification({
title: 'Success!',
message: response.data.message,
type: 'success'
});
return response;
},
(response) => {
this.bulkDecline(requests, decliner);
}
);
}
但它好像不工作。
您可以從[這裏](http://stackoverflow.com/a/10024557/1610034)獲取靈感。 – Saurabh