java代碼:
@RequestMapping("/showDiagram")
// 顯示流程圖
public String showDiagram(HttpServletResponse response) {
OutputStream out = null;
String processInstanceId = "5001";
try {
// HttpServletResponse response = ServletActionContext.getResponse();
InputStream is = this.getDiagram(processInstanceId);
response.setContentType("image/png;charset=utf8");
out = response.getOutputStream();
out.write(getImgByte(is));
out.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (Exception e) {
}
}
return null;
}
vue 代碼:
greet() {
var url = '/sde/showDiagram/';
this.$axios.post(url, {
responseType:'arraybuffer',
// headers: {'Content-Type': 'multipart/form-data;charset=UTF-8'},
}).then(res => {
console.log(res.data);
// document.getElementById("imgTest").src = res.data;
})
}
uj5u.com熱心網友回復:
這個問題解決了嗎轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/282794.html
標籤:JavaScript
上一篇:Vue 官網學習筆記
