@ RequestMapping ("/showDiagram ")
//show the flow chart of
Public String showDiagram (HttpServletResponse response) {
OutputStream out=null;
String processInstanceId="5001";
Try {
//HttpServletResponse response=ServletActionContext. The method getResponse ();
InputStream is=this. GetDiagram (processInstanceId);
The response. SetContentType (" image/PNG; Charset=utf8 ");
Out=response. GetOutputStream ();
Out. Write (getImgByte (is));
Out. The flush ();
} the catch (Exception e) {
e.printStackTrace();
} the finally {
Try {
Out. The close ();
} the catch (Exception e) {
}
}
return null;
}
Vue code:
Greet () {
Var url='/sde/showDiagram/';
This $axios. Post (url, {
ResponseType: 'arraybuffer',
//headers: {' the content-type ':' multipart/form - data; Charset=utf-8 '},
}). Then (res=& gt; {
The console. The log (res. Data);
//the document. The getElementById (" imgTest "). The SRC=https://bbs.csdn.net/topics/res.data;
})
}
CodePudding user response:
This problem solved