前端做导出的时候,response中无流信息,但是把参数放到postman中测试确有流信息。
let str =
`http:192.168.2.49:10002/jysp-cruise-server/cruise/result/exportRunningLogWord?directCurrent=${row.directCurrent}&alternatingCurrent=${row.alternatingCurrent}`;
const link = document.createElement("a");
link.style = "display: none;";
link.href = str;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
后端提供的接口是get请求,但是前端在传参的时候需要对参数进行编码。否则接口会一直调取失败。至于为什么要编码,后端未说明情况
${encodeURIComponent(row.directCurrent)}&alternatingCurrent=${encodeURIComponent(row.alternatingCurrent)}