Merge pull request #451 from chengzhongxue/main

修复评论500问题,修复ai bug
This commit is contained in:
困困鱼 2023-08-28 02:25:14 +08:00 committed by GitHub
commit dc70597a6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 7 deletions

View File

@ -1195,8 +1195,8 @@ spec:
value:
aiDescriptionEnable: false
gptName:
mode:
switchBtn:
mode: local
switchBtn: false
btnLink:
randomNum:
basicWordCount:

View File

@ -235,7 +235,7 @@ var btf = {
})
}
))
document.querySelectorAll('#article-container .timeline')[0]?.classList.remove("loadings");
document.querySelectorAll('#article-container .loadings')[0]?.classList.remove("loadings");
},
diffDate: (d, more = false) => {

View File

@ -232,7 +232,10 @@
switch: [[${ theme.config.tool.snackbar.switch }]]
},
postAi:{
ai : '[(${post.status.excerpt})]',
ai : [[${htmlType != 'post' || !theme.config.post.aiDescription.aiDescriptionEnable ? '' :
theme.config.post.aiDescription.mode != 'local' && !theme.config.post.aiDescription.switchBtn ? '' :
post.spec.excerpt.autoGenerate ? '本地模式需要自己填写文章摘要' :
#strings.isEmpty(post.status.excerpt) ? '请填写文章摘要' : post.status.excerpt }]],
randomNum : [[${theme.config.post.aiDescription.randomNum}]],
basicWordCount : [[${theme.config.post.aiDescription.basicWordCount}]],
btnLink : "[(${theme.config.post.aiDescription.btnLink})]",

View File

@ -7,7 +7,7 @@
<th:block th:if="${#strings.equals(theme.config.comments.use, 'commentWidget') }">
<div class="aside-list-item" th:each="comment,iterStat : ${commentFinder.list(null, 1, 20)}"
th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) :
comment.spec.subjectRef.kind == 'SinglePage' ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
comment.spec.subjectRef.kind == 'SinglePage' && not #strings.contains('photos,links,moments', comment.spec.subjectRef.name) ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
url = ${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}"
th:if="${iterStat.index < theme.config.sidebar.newcommentnumber}">
<span th:text="${commentIndex}"></span>

View File

@ -19,7 +19,7 @@
<!-- BUG由于当前的列出所有评论API无过滤功能非文章页的评论无法查询到页面信息所以非文章评论跳转至首页-->
<div class="aside-list-item" th:each="comment,iterStat : ${commentFinder.list(null, 1, 20)}"
th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) :
comment.spec.subjectRef.kind == 'SinglePage' ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
comment.spec.subjectRef.kind == 'SinglePage' && not #strings.contains('photos,links,moments', comment.spec.subjectRef.name) ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
url = ${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}"
th:if="${iterStat.index < 6}" >
<a th:href="${url}" class="thumbnail" data-pjax-state="">

View File

@ -192,7 +192,7 @@
<!--/* 评论组件 */-->
<th:block th:replace="~{modules/comment :: comment(group = 'content.halo.run',
kind = 'SinglePage',
name = 'moments',
name = 'photos',
allowComment = true)}" />
</div>