Skip to content

Commit

Permalink
调整 扩展登录后能力
Browse files Browse the repository at this point in the history
修复由halo删除配置默认值导致的关闭分享功能时引发的bug
  • Loading branch information
mjsoftking committed Dec 16, 2024
1 parent 7457a30 commit 4a3759c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ spec:
- $formkit: radio
name: expand_login_skill
label: 扩展登录后能力
help: 开启后,在文章详情界面,根据作者身份显示编辑按钮。控制台按钮 - 登录组件样式 添加 新建文章 和 发布瞬间 菜单项。登录用户需要具有进入控制台的权限
help: 开启后,在文章详情界面,根据作者身份显示编辑按钮。控制台按钮 - 登录组件样式 添加 新建文章 和 发布瞬间 菜单项。登录用户需要具有进入相应功能的权限
value: 'console'
options:
- label: 控制台
- label: 跳转到控制台
value: 'console'
- label: 个人
- label: 跳转到个人中心
value: 'uc'
- label: 关闭
value: 'none'
Expand Down
11 changes: 7 additions & 4 deletions templates/common/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@
DreamConfig["pjax_state"] = [[${theme.config.enhance.enable_pjax}]];
/** 配置分享方式 */
let post_share = []
for (let share of [[${theme.config.post.custom_post_share}]]) {
let type = share.realNode.type;
if (post_share.indexOf(type) === -1) {
post_share.push(type);
let custom_post_share = [[${theme.config.post.custom_post_share}]];
if(custom_post_share) {
for (let share of custom_post_share) {
let type = share.realNode.type;
if (post_share.indexOf(type) === -1) {
post_share.push(type);
}
}
}
if (post_share.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion templates/main/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1 class="title" th:text="${post.spec.title}"></h1>
<li><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
<li><i class="ri-quill-pen-line"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li>
<li th:if="${logonUserName == post.spec.owner && (skillUrl == 'console' || (skillUrl == 'uc' && isPost))}" class="is-hidden-laptop">
<a target="_blank" title="编辑文章" th:href="@{|/skillUrl/${isPost ? 'posts' : 'single-pages'}/editor?name=${post.metadata.name}|}"><i class="ri-edit-2-line"></i>编辑</a></li>
<a target="_blank" title="编辑文章" th:href="@{|/${skillUrl}/${isPost ? 'posts' : 'single-pages'}/editor?name=${post.metadata.name}|}"><i class="ri-edit-2-line"></i>编辑</a></li>
</ul>
<div th:if="${isPost && !#lists.isEmpty(post.categories)}" class="level-item">
<a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}"
Expand Down
2 changes: 1 addition & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.3.3.beta4
version: 1.3.3.beta5
# 最低支持的 Halo 版本
require: ">=2.20.0"
# 许可
Expand Down

0 comments on commit 4a3759c

Please sign in to comment.