mirror of
https://gitee.com/liweiyi/ChestnutCMS.git
synced 2025-12-06 16:38:24 +08:00
修正内容标签获取内容状态失败问题,修正删除索引异常,扩展模型资源文件上传组件异常修正
This commit is contained in:
parent
722eb3b9fb
commit
df1edc879f
@ -106,6 +106,9 @@ public class TagContentVO extends TagBaseVO {
|
||||
@XComment("内容属性标识列表")
|
||||
private String[] attributes;
|
||||
|
||||
@XComment("内容状态")
|
||||
private String status;
|
||||
|
||||
@XComment("是否链接内容")
|
||||
private String linkFlag;
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ public class CatalogPageSizeProperty implements IProperty {
|
||||
|
||||
@Override
|
||||
public boolean validate(String value) {
|
||||
return StringUtils.isEmpty(value) || NumberUtils.isCreatable(value.toString());
|
||||
return StringUtils.isEmpty(value) || NumberUtils.isCreatable(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -37,13 +37,13 @@ public class ESSearchListener {
|
||||
private final ContentIndexService contentIndexService;
|
||||
|
||||
@EventListener
|
||||
public void afterSiteDelete(AfterSiteDeleteEvent event) {
|
||||
public void afterSiteDelete(AfterSiteDeleteEvent event) throws IOException {
|
||||
if (!contentIndexService.isElasticSearchAvailable()) {
|
||||
return;
|
||||
}
|
||||
CmsSite site = event.getSite();
|
||||
contentIndexService.deleteIndex(site);
|
||||
}
|
||||
}
|
||||
|
||||
@EventListener
|
||||
public void afterSiteAdd(AfterSiteAddEvent event) {
|
||||
|
||||
@ -130,16 +130,26 @@ public class ContentIndexService implements CommandLineRunner {
|
||||
/**
|
||||
* 删除站点索引库
|
||||
*/
|
||||
public void deleteIndex(CmsSite site) {
|
||||
public void deleteIndex(CmsSite site) throws IOException {
|
||||
String indexName = CmsSearchConstants.indexName(site.getSiteId().toString());
|
||||
try {
|
||||
boolean exists = esClient.indices().exists(fn -> fn.index(indexName)).value();
|
||||
deleteIndex(indexName);
|
||||
}
|
||||
|
||||
public void deleteIndex(String indexName) throws IOException {
|
||||
boolean exists = esClient.indices().exists(fn -> fn.index(indexName)).value();
|
||||
if (!exists) {
|
||||
return;
|
||||
}
|
||||
esClient.indices().delete(fn -> fn.index(indexName));
|
||||
while(exists) {
|
||||
exists = esClient.indices().exists(fn -> fn.index(indexName)).value();
|
||||
if (exists) {
|
||||
return;
|
||||
}
|
||||
esClient.indices().delete(fn -> fn.index(indexName));
|
||||
} catch (IOException e) {
|
||||
log.error("Delete elasticsearch index failed: " + indexName, e);
|
||||
try {
|
||||
Thread.sleep(2000);
|
||||
} catch (InterruptedException e) {
|
||||
log.warn(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,14 +277,7 @@ public class ContentIndexService implements CommandLineRunner {
|
||||
if (exists) {
|
||||
// 先删除内容索引文档
|
||||
deleteContentIndices(site);
|
||||
|
||||
esClient.indices().delete(fn ->fn.index(indexName));
|
||||
while(exists) {
|
||||
exists = esClient.indices().exists(fn -> fn.index(indexName)).value();
|
||||
if (exists) {
|
||||
Thread.sleep(2000);
|
||||
}
|
||||
}
|
||||
deleteIndex(indexName);
|
||||
}
|
||||
createIndex(site);
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.3 KiB |
@ -147,6 +147,9 @@ export default {
|
||||
getResourceFileIconClass(index) {
|
||||
return getFileSvgIconClass(this.fileList[index].src)
|
||||
},
|
||||
isImageResource (index) {
|
||||
return isImage(this.fileList[index].src);
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user