Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/galaxy-book/captcha-golang-demo

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/galaxy-book/captcha-golang-demo

  • v0.0.0-20201023100527-4940cacacd4d
  • Source
  • Go
  • Socket score

Version published
Created
Source

captcha-golang-demo

易盾验证码golang演示

demo运行步骤

  • 修改web/index.html中的YOUR_CAPTCHA_ID
initNECaptcha({
  captchaId: 'YOUR_CAPTCHA_ID',
  element: '#captcha_div',
  mode: 'float', // 如果要用触发式,这里改为float即可
  width: '320px',
  onVerify: function(err, ret){
    if(!err){
        $.ajax({
            type: "POST",
            url: "/verify" ,
            data: ret,
            success: function (result) {
               alert(result)
            },
            error : function() {
                alert("异常!");
            }
        });
    }
  }
}, function (instance) {
  // 初始化成功后得到验证实例instance,可以调用实例的方法
}, function (err) {
  // 初始化失败后触发该函数,err对象描述当前错误信息
})
  • 修改 main.go
const(
    captchaId = "YOUR_CAPTCHA_ID"
    secretId = "YOUR_SECRET_ID"
    secretKey = "YOUR_SECRET_KEY"
)
  • go run main.go
  • 浏览器访问 http://localhost:8080/ 查看演示

FAQs

Package last updated on 23 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc