Git Product home page Git Product logo

bz-geetest's Introduction

bz-geetest

播种网极验验证码模块

版本

版本号
0.1.0 A 极验验证码插件
0.2.0 F 兼容浏览器调用
A 统一使用captchaObj对象的函数名作为外部传入函数,同时返回captchaObj对象作为参数

打包

npm run build

接口

geetest(tokenType, geetestOptions, callback)

Arguments

  • tokenType(string)token类型

    • 可选,默认geetest
    - type  string 支持类型
      新用户注册  member_register
        用户登录  member_login
        手机注册获取校验码的验证码 member_register_get_phone_code
        发表信息    forum_post_newthread 发帖,forum_post_reply 回帖
        修改密码    member_resetpwd
        充值卡密    未使用
        斯利安      silian
        忘记密码    member_register_findpwd
        活动        huodong
        疯狂造人    crazy
        geetest验证码类 geetest
        --没有相关的参数 请联系接口的开发者
  • geetestOptions (Object)极验内部参数

    • product:默认embed ,这是是以前的参数,支持
    参数 类型 说明 默认值 可选值
    product 字符串 设置下一步验证的展现形式 popup float、popup、custom、bind
    width 字符串 设置按钮的长度 300px 单位可以是 px,%,em,rem,pt
    lang 字符串 设置验证界面文字的语言 zh-cn zh-cn、zh-hk、zh-tw、en、ja、ko、id、ru、ar、es、pt-pt、fr、de
    https 布尔 是否使用 https 请求 false true。不进行设置,默认取当前页面协议,本地文件直接打开测试与hybrid开发使用请设置true
    timeout 数字 设置验证过程中单个请求超时时间 30000(ms) 大于0的整数

    更多接口参考:https://docs.geetest.com/install/apirefer/api/web

  • fn (Function)验证成功回调 (v0.1.0)

  • 统一使用captchaObj对象的函数名作为外部传入函数,同时返回captchaObj对象作为参数(v0.2.0)

    onError、onFail、onReady、onRefresh、onSuccess等

Example

script 标签引用极验

<script src="https://static.geetest.com/static/tools/gt.js"></script>

module模式

<script src="./bz-geetest/0.1.0/bz-geetest.js"></script>
<script>
  window['bz-geetest'].geetest({
    tokenType: 'geetest',
    geetestOptions: {
      product: 'embed'
    },
    onSuccess: function() {
      console.log('成功');
    }
  });
</script>

seaJS模式

<script>
	seajs.use(['./bz-geetest/0.1.0/bz-geetest.js'], function() {
  window['bz-geetest'].geetest({
    tokenType: 'geetest',
    geetestOptions: {
      product: 'embed'
    },
    onSuccess: function() {
      console.log('成功');
    }
  });
});  
</script>

requireJS

<script>
  require(['./bz-geetest/0.1.0/bz-geetest'], function(geetest) {
    geetest.geetest({
      tokenType: 'geetest',
      geetestOptions: {
        product: 'embed'
      },
      onSuccess: function() {
        console.log('成功');
      }                                   
    });
  });
</script>

bz-geetest's People

Contributors

benpjj avatar unclay avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.