fix(模板管理): 模板管理不能创建分类问题

This commit is contained in:
wangjiahao 2022-08-03 13:59:44 +08:00
parent 7b9a7a2aba
commit 557b2f306f

View File

@ -80,11 +80,14 @@ public class PanelTemplateService {
exampleDelete.createCriteria().andPidEqualTo(request.getPid()).andNameEqualTo(request.getName());
panelTemplateMapper.deleteByExample(exampleDelete);
}
//Store static resource into the server
staticResourceService.saveFilesToServe(request.getStaticResource());
String snapshotName = "template-" + request.getId() + ".jpeg";
staticResourceService.saveSingleFileToServe(snapshotName,request.getSnapshot().replace("data:image/jpeg;base64,","") );
request.setSnapshot("/"+UPLOAD_URL_PREFIX+'/'+snapshotName);
if ("template".equals(request.getNodeType())) {
//Store static resource into the server
staticResourceService.saveFilesToServe(request.getStaticResource());
String snapshotName = "template-" + request.getId() + ".jpeg";
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
request.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
}
panelTemplateMapper.insert(request);
} else {
String nameCheckResult = this.nameCheck(CommonConstants.OPT_TYPE.UPDATE, request.getName(), request.getPid(), request.getId());