axios请求后端数据
this.$axios({
url: 'http://119.29.140.134/api/city',
method: 'post',
headers: {
'Content-Type': 'application/json'
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
数据导出
this.$api.getPSQAddressInfo().then(res => {
var FileSaver = require('file-saver');
var content = JSON.stringify(res.data);
var blob = new Blob([content ], {type: "text/plain;charset=utf-8"});
FileSaver.saveAs(blob, "address.json");
})