前端来讲用axios下载:
请求方式:
export function exportUser(jsonObj) {//导出用户数据
return fetch({
url: '/api/frontUser/user/exportUser',
method: 'post',
params: jsonObj,
responseType: 'arraybuffer', //
});
}
转自:https://blog.youkuaiyun.com/happyheng/article/details/53687769
本文介绍了一种在前端开发中使用Axios进行数据导出的方法。通过定义一个导出用户数据的函数,利用fetch API以post方式请求'/api/frontUser/user/exportUser'接口,并设置responseType为arraybuffer,实现数据的下载功能。
1948

被折叠的 条评论
为什么被折叠?



