diff --git a/src/main/java/run/halo/comment/widget/SettingConfigGetter.java b/src/main/java/run/halo/comment/widget/SettingConfigGetter.java index 1b20d3f..a0e3163 100644 --- a/src/main/java/run/halo/comment/widget/SettingConfigGetter.java +++ b/src/main/java/run/halo/comment/widget/SettingConfigGetter.java @@ -15,7 +15,7 @@ public interface SettingConfigGetter { @Accessors(chain = true) class SecurityConfig { @Getter(onMethod_ = @NonNull) - private CaptchaConfig captcha; + private CaptchaConfig captcha = CaptchaConfig.empty(); public SecurityConfig setCaptcha(CaptchaConfig captcha) { this.captcha = (captcha == null ? CaptchaConfig.empty() : captcha); diff --git a/src/main/resources/extensions/settings.yaml b/src/main/resources/extensions/settings.yaml index badf54c..b812553 100644 --- a/src/main/resources/extensions/settings.yaml +++ b/src/main/resources/extensions/settings.yaml @@ -37,6 +37,9 @@ spec: - $formkit: group name: captcha label: 验证码 + value: + enable: false + type: ALPHANUMERIC children: - $formkit: checkbox label: 匿名评论需要验证码 @@ -68,8 +71,8 @@ spec: if: "$get(enable).value === true" name: provider options: - - label: 'Gravatar' - value: 'gravatar' + - label: "Gravatar" + value: "gravatar" value: "gravatar" - $formkit: text label: 头像服务镜像地址 @@ -82,10 +85,10 @@ spec: if: "$get(enable).value === true" name: policy options: - - label: '仅匿名用户' - value: 'anonymousUser' - - label: '所有用户' - value: 'allUser' - - label: '匿名&无头像用户' - value: 'noAvatarUser' + - label: "仅匿名用户" + value: "anonymousUser" + - label: "所有用户" + value: "allUser" + - label: "匿名&无头像用户" + value: "noAvatarUser" value: "anonymousUser"