简体   繁体   English

meteor autoform的简单验证码字段类型

[英]simple captcha field type for meteor autoform

I need a simple captcha field type for my form. 我的表单需要一个简单的验证码字段类型。 I used meteor-autoform for generating form. 我用meteor-autoform生成表格。

I don't know how to create custom (captcha) field type for auto-form. 我不知道如何为自动表单创建自定义(验证码)字段类型。

For example how to wrap this node.js module to auto-form add-on. 例如,如何将此 node.js模块包装为自动格式加载项。

I also don't want to use google reCaptcha. 我也不想使用谷歌reCaptcha。

Please guide me. 请指导我。

Ok a common issue when building with meteor is figuring out how to include node packages in a meteor project. 使用meteor进行构建时,常见的问题是如何在流星项目中包含节点包。 Here's the way I do it! 这就是我的方式!

  1. Install the lovely meteorhacks:npm package which allows for easy node package wrapping. 安装可爱的meteorhacks:npm包,允许简单的节点包裹包装。

meteor add meteorhacks:npm

  1. Edit the packages.json file (which meteorhacks adds to your meteor project root) 编辑packages.json文件(meteorhacks将其添加到您的meteor项目根目录)

The packages.json file should something like this: packages.json文件应该是这样的:

{
   "node-captcha" : "0.2.1"
}

Note: 0.2.1 is the latest package version of node-captcha which I found on the npm link you supplied. 注意:0.2.1是我在你提供的npm链接上找到的node-captcha的最新包版本。 Anytime you are including a node package using meteorhacks:npm, you need to list a node package version. 每当您使用meteorhacks包含节点包时:npm,您需要列出节点包版本。

  1. node-captcha can now be included in your meteor js files by using the following statement: 现在,node-captcha可以使用以下语句包含在meteor js文件中:

Meteor.npmRequire('node-captcha');

This should do the trick! 这应该做的伎俩! Please accept my answer if this is what you are looking for :) 如果这是你要找的话,请接受我的回答:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM