問(wèn)題描述:
發(fā)現(xiàn)“文件.xlsx”中的部分內(nèi)容有問(wèn)題。是否讓我們盡量嘗試恢復(fù)?
問(wèn)題分析:
1、后端的導(dǎo)出接口寫的不對(duì),又返回流數(shù)據(jù),又返回響應(yīng)體數(shù)據(jù),導(dǎo)致前端將流數(shù)據(jù)和響應(yīng)體數(shù)據(jù)都下載到了excel文件中。
@PostMapping("/export")
public Result export(HttpServletResponse response) {
poDetailAppService.export(response);
return Result.ok();
}
?解決辦法:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-535644.html
接口僅返回流數(shù)據(jù)即可。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-535644.html
@PostMapping("/export")
public void export(HttpServletResponse response) {
poDetailAppService.export(response);
}
到了這里,關(guān)于Java Excel 打開(kāi)文件報(bào)發(fā)現(xiàn)“xx.xlsx”中的部分內(nèi)容有問(wèn)題。是否讓我們盡量嘗試恢復(fù)問(wèn)題解決的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!