我正在使用vuejs并向服务器发出axios请求以下载csv。
download() {
var that = this
//this.records = [{id: 1, name: 'Jack'}, {id: 2, name: 'Jacky'}, {id: 3, name: 'Jackie'}.....100s]
//this.header = [{value: 'id', text: 'ID'}, {value: 'name', text: 'Name'}]
var headers = this.header.map(a => a.text);
var url = USERS_REPORT_DOWNLOAD_URL + '?';
this.$axios.get(url, { params: { users: this.records, headers: headers}, responseType: 'blob' })
.then(response => {
var file = new Blob([response.data]);
FileSaver.saveAs(file, 'users ' + moment().format('MMMM Do YYYY, hh-mm a') + '.xls');
});
}
调用此方法时,返回HTTP Error 414 - The request URL is too long
。可能是因为参数太长。请帮助我解决此问题。
1条答案
按热度按时间5lhxktic1#