export const post = (url, data = {}) => {
Spin.show(); // 显示加载框
return new Promise((resolve, reject) => {
axios
.post(url, qs.stringify(data, {
arrayFormat: 'repeat'
}))
.then(response => {
Spin.hide(); // 隐藏加载框
resolve(response.data);
})
.catch(err => {
Spin.hide(); // 隐藏加载框
reject(err);
});
});
};
export const realPost = (url, data = {}) => {
Spin.show(); // 显示加载框
return new Promise((resolve, reject) => {
axios
.post(url, data)
.then(response => {
Spin.hide(); // 隐藏加载框
resolve(response.data);
})
.catch(err => {
Spin.hide(); // 隐藏加载框
reject(err);
});
});
};
网友评论