后端接口返回文件流,前端解析成数据使用
目录
后端接口返回文件流,前端解析成数据使用
boundaryDownloadFile({ type: 1 }).then(res => {
var reader = new FileReader();
reader.readAsText(res);
reader.onload = function () {
if (this.readyState === 2) {
let result = JSON.parse(this.result);
MapBoxService.drawRoadLine(result, this.mapBoxMap, 'device-roadline');
}
}
});