Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

昵称和邮箱 #281

Merged
merged 1 commit into from Apr 22, 2020
Merged

昵称和邮箱 #281

merged 1 commit into from Apr 22, 2020

Conversation

xaoxuu
Copy link
Contributor

@xaoxuu xaoxuu commented Apr 21, 2020

如果您希望保留匿名评论的选择,建议开放一个参数,让站长可以选择是否要求填写昵称和邮箱。

如果必须填写昵称和邮箱,则昵称至少3个字符,邮箱至少6个字符且必须包含@.

例如 a@t.io 这已经是邮箱的最短结构了

如果您希望保留匿名评论的选择,建议开放一个参数,让站长可以选择是否要求填写昵称和邮箱。

如果必须填写昵称和邮箱,则昵称至少3个字符,邮箱至少6个字符且必须包含`@`和`.` 
> 例如 `a@t.io` 这已经是邮箱的最短结构了
@redstoneleo
Copy link

建议还是增加下“必填邮箱”这个选项,以便站长有权把Valine当作匿名还是非匿名的评论系统,我搜了下有好几个类似的issue呢。
没有强制输入email的功能气人的一点是:你耐心地回复了别人,结果人家没有回看,得不偿失啊!

@xCss
Copy link
Owner

xCss commented Apr 22, 2020

requiredFields

  • 类型: Array
  • 默认值: []
  • 必要性: false

设置必填项,默认匿名,可选值:

  • ['nick']
  • ['nick','mail']

v1.4.6+ 已经开始支持~ 感谢提交PR

@redstoneleo
Copy link

我提议的是允许加required 属性,详情https://www.w3school.com.cn/html5/att_input_required.asp
能否考虑下呢?

@xCss
Copy link
Owner

xCss commented Apr 22, 2020

我提议的是允许加required 属性,详情https://www.w3school.com.cn/html5/att_input_required.asp
能否考虑下呢?

这并不是Form提交,required属性不生效

@xCss xCss closed this Apr 22, 2020
@xCss xCss reopened this Apr 22, 2020
@xCss xCss merged commit 9889dcd into xCss:master Apr 22, 2020
@xaoxuu
Copy link
Contributor Author

xaoxuu commented Apr 22, 2020

@xCss 你好,我测试了 ['nick','mail'] 昵称仍然不需要输入就可以发评论

@xCss
Copy link
Owner

xCss commented Apr 22, 2020

@xaoxuu 测试地址有么!我看看,我本地测试正常~

@xaoxuu
Copy link
Contributor Author

xaoxuu commented Apr 22, 2020

@xCss
Copy link
Owner

xCss commented Apr 22, 2020

@xaoxuu 已复现并找出了问题所在,下个版本更新,感谢反馈

@xaoxuu
Copy link
Contributor Author

xaoxuu commented Apr 22, 2020

👌

@redstoneleo
Copy link

redstoneleo commented Apr 22, 2020

我提议的是允许加required 属性,详情https://www.w3school.com.cn/html5/att_input_required.asp
能否考虑下呢?

这并不是Form提交,required属性不生效

required属性适用于input element
https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/input
https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required

@redstoneleo
Copy link

https://valine.js.org/en/configuration.html#requiredFields
里面的optional values实际上还可以是['mail'],请改正

@kuretru
Copy link

kuretru commented Aug 1, 2020

这个设置很坑爹啊,我的昵称就2个字,现在没法回复了

@so1ve
Copy link

so1ve commented Aug 13, 2020

我提议的是允许加required 属性,详情https://www.w3school.com.cn/html5/att_input_required.asp
能否考虑下呢?

这并不是Form提交,required属性不生效

required属性适用于input element
https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/input
https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required

实际上没有用 这个东西直接看源代码就完事了

@chaoyangya
Copy link

已经设置了 requiredFields = ['nick','mail'] 但是还是可以匿名评论 可以麻烦看下吗 测试地址:https://cywhat.cn/

@xCss
Copy link
Owner

xCss commented Jan 14, 2022

已经设置了 requiredFields = ['nick','mail'] 但是还是可以匿名评论 可以麻烦看下吗 测试地址:https://cywhat.cn/

image
image

@chaoyangya
Copy link

噢噢 1.4.14版本是小于1.4.6的是吧大佬 想了解下如何升级,我用的是hugo中loveit主题的静态博客

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants