New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

easy-tencent-captcha

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-tencent-captcha

plugins for tencent-captcha

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

easy-tencent-captcha

专门针对腾讯防水墙做了一些简单的封装,理论上react和vue都可以用.

使用方式

npm i easy-tencent-captcha --save
import Captcha from 'easy-tencent-captcha'
const captcha = new Captcha({
  appId: 'xxxxx'
})
// 方法 1
captcha.showCaptcha({
  success (res) {
    console.log(res) // {bizState: xxx, appid: "xxx", ret: 0, ticket: "xxx", randstr: "xxx"}
  }
 })
 // 方法 2
 try {
   const res = await captcha.showCaptcha()
   console.log(res) // {bizState: xxx, appid: "xxx", ret: 0, ticket: "xxx", randstr: "xxx"}
 } catch (err) {
   console.log(err)
 }
 

API

.showCaptcha(options)

调起验证框

optionparams备注
successres用户验证成功回调
errorerr一般是用户关闭窗口回调

.closeCaptcha()

关闭验证框

.getTicket()

获取验证码验证成功后的ticket

const res = await captcha.getTicket()
console.log(res) // {"appid":"","ticket":""}

Keywords

FAQs

Package last updated on 24 Jun 2022

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