npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yidun/tt-ne-captcha

v1.0.0

Published

字节跳动小程序版易盾验证码

Downloads

3

Readme

易盾验证码用户使用文档--字节跳动小程序版

引入

在根目录执行下述命令

  npm install @yidun/tt-ne-captcha

使用

  1. 引用声明组件,在页面或组件的json文件中声明
{
  "usingComponents": {
    "ne-captcha": "path-to-component/ne-captcha/index"
  }
}
  1. 使用组件
<view>
  <ne-captcha
    id="neCaptcha"
    captcha-id="yourCaptchaID"
    width="640rpx"
    bindverify="handleVerify"></ne-captcha>
  <view>
    <button bindtap="openCaptcha">点击验证</button>
  </view>
</view>
Page({
  handleVerify (ev) {
    if (ev.detail[0]) {
      // 验证失败
      return
    }
    
    // TODO: 验证成功
    console.log(ev.detail[1])
  },
  openCaptcha () {
    this.selectComponent('#neCaptcha', res => {
      res && res.popup()
      // 智能无感知请调用 res.verify()
    })
  }
})

属性

| 可配项 | 类型 | 默认值 | 描述 | |--------|-------|----------|-------| | captchaId | String | 无 | 验证码ID | | lang | String | 'zh-CN' | 语言 | | width | String | 'auto' | 验证码弹框宽度,接受单位'rpx'/'px'/'rem'/'%' | | captchaType | String | 无 | 配置验证码类型 | | customStyles | Object | null | 自定义验证码样式,包含imagePanel/controlBar/gap/popTitle/popPadding,详情查看下面 |

**注意:**小程序的超时设置可在app.json全局配置

customStyles

  • imagePanel
    • borderRadius(String): imagePanel的圆角大小
  • controlBar
    • borderRadius(String): controlBar的圆角大小
    • height(String): controlBar的高度
  • gap: imagePanel和controlBar的间隔
  • popTitle
    • height(String): 弹框头部高度
  • popPadding(String): 弹框体内边距

事件

| 事件名 | 参数 | 描述 | |-------|------|------| | error | 无 | 验证码配置失败 | | init | 无 | 验证码配置成功(初始化)| | ready | 无 | 验证码准备就绪 | | verify | err,validate | 验证码验证完成 | | close | 无 | 验证码弹框准备关闭 |

组件方法

popup: 展示验证码 reset: 重置验证码,获取新的验证信息 verify: 智能无感知验证码进行验证 getCaptchaType: 获取验证码类型

域名

  1. 服务器域名:c.dun.163yun.com、c.dun.163.com
  2. 图片域名:necaptcha.nosdn.127.net、nos.netease.com