fix(测试跟踪): 下载xmind模板失败

--bug=1018264 --user=陈建星 【测试跟踪】下载xmind模版-打开失败,提示“文件已损坏” https://www.tapd.cn/55049933/s/1265339
This commit is contained in:
chenjianxing 2022-10-18 10:32:01 +08:00 committed by jianxing
parent 0556a44c4d
commit 7b5abfe4b3
11 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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.

View File

@ -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);
},