fix(测试跟踪): 下载xmind模板失败
--bug=1018264 --user=陈建星 【测试跟踪】下载xmind模版-打开失败,提示“文件已损坏” https://www.tapd.cn/55049933/s/1265339
This commit is contained in:
parent
0556a44c4d
commit
7b5abfe4b3
|
@ -248,7 +248,7 @@ public class TestCaseController {
|
|||
testCaseService.testCaseTemplateExport(projectId, importType, response);
|
||||
}
|
||||
|
||||
@GetMapping("/export/xmindTemplate/{projectId}/{importType}")
|
||||
@GetMapping("/export/xmind/template/{projectId}/{importType}")
|
||||
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EXPORT)
|
||||
public void xmindTemplate(@PathVariable String projectId, @PathVariable String importType, HttpServletResponse response) {
|
||||
testCaseService.testCaseXmindTemplateExport(projectId, importType, response);
|
||||
|
|
|
@ -1362,7 +1362,7 @@ public class TestCaseService {
|
|||
// 发送给客户端的数据
|
||||
byte[] buff = new byte[1024];
|
||||
try (OutputStream outputStream = res.getOutputStream();
|
||||
BufferedInputStream bis = new BufferedInputStream(TestCaseService.class.getResourceAsStream("/io/metersphere/xmind/template/" + fileName));) {
|
||||
BufferedInputStream bis = new BufferedInputStream(TestCaseService.class.getClassLoader().getResourceAsStream("xmind/" + fileName));) {
|
||||
int i = bis.read(buff);
|
||||
while (i != -1) {
|
||||
outputStream.write(buff, 0, buff.length);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -157,7 +157,7 @@ export default {
|
|||
downloadXmindTemplate() {
|
||||
let uri = '/test/case/export/template/';
|
||||
if (this.isXmind) {
|
||||
uri = '/test/case/export/xmindTemplate/';
|
||||
uri = '/test/case/export/xmind/template/';
|
||||
}
|
||||
this.$fileDownload(uri + getCurrentProjectID() + '/' + this.importType);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue