Skip to content

Commit 59f6d2c

Browse files
committed
fix: rendering issue due to missing default values (halo-dev#139)
* fix: rendering issue due to missing default values Signed-off-by: Ryan Wang <[email protected]> * Set default values for captcha Signed-off-by: Ryan Wang <[email protected]>
1 parent 04ee023 commit 59f6d2c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/main/java/run/halo/comment/widget/SettingConfigGetter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface SettingConfigGetter {
1515
@Accessors(chain = true)
1616
class SecurityConfig {
1717
@Getter(onMethod_ = @NonNull)
18-
private CaptchaConfig captcha;
18+
private CaptchaConfig captcha = CaptchaConfig.empty();
1919

2020
public SecurityConfig setCaptcha(CaptchaConfig captcha) {
2121
this.captcha = (captcha == null ? CaptchaConfig.empty() : captcha);

src/main/resources/extensions/settings.yaml

+11-8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ spec:
3737
- $formkit: group
3838
name: captcha
3939
label: 验证码
40+
value:
41+
enable: false
42+
type: ALPHANUMERIC
4043
children:
4144
- $formkit: checkbox
4245
label: 匿名评论需要验证码
@@ -68,8 +71,8 @@ spec:
6871
if: "$get(enable).value === true"
6972
name: provider
7073
options:
71-
- label: 'Gravatar'
72-
value: 'gravatar'
74+
- label: "Gravatar"
75+
value: "gravatar"
7376
value: "gravatar"
7477
- $formkit: text
7578
label: 头像服务镜像地址
@@ -82,10 +85,10 @@ spec:
8285
if: "$get(enable).value === true"
8386
name: policy
8487
options:
85-
- label: '仅匿名用户'
86-
value: 'anonymousUser'
87-
- label: '所有用户'
88-
value: 'allUser'
89-
- label: '匿名&无头像用户'
90-
value: 'noAvatarUser'
88+
- label: "仅匿名用户"
89+
value: "anonymousUser"
90+
- label: "所有用户"
91+
value: "allUser"
92+
- label: "匿名&无头像用户"
93+
value: "noAvatarUser"
9194
value: "anonymousUser"

0 commit comments

Comments
 (0)