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/quickpass-sdk-h5

v3.0.0

Published

易盾本机校验H5 SDK

Downloads

15

Readme

本机校验H5使用手册

引入SDK

  1. npm引入
npm install --save @yidun/quickpass-sdk-h5
  1. script引入

netease-quickpass-sdk.umd.js将暴露NEQuickPass变量,引入方式如下:

<script src="./yourPath/netease-quickpass-sdk.umd.js"></script>

初始化

var sdk = new NEQuickPass('从易盾申请到的appId')

params对象参数

| 参数 | 类型 | 默认值 | 含义 | |-----------|-----------|-----------|----------| | timeout | Number | 120000 | 设置getToken流程的超时时间 |

示例

var sdk = new NEQuickPass('从易盾申请到的appId', { timeout: 120000 })

获取秘钥

调用实例的getToken方法可获取验证秘钥。getToken支持回调函数和promise。

sdk.getToken(mobile, function (err, data) {
  if (err) {
    // 获取秘钥发生错误,请处理
    return
  }
  // 取号流程完成,等待验证,data为{ accessToken: 'xxx...', token: 'xxx...' }
})

上传秘钥

将获取到的accessToken、token上传至客户服务端,由服务端调用本机校验服务提供的相应接口

开发指南

目录介绍

Demo

包含对内测试和对外演示

其中 index.html 对内测试,仅包含号码认证的功能

quickpass.html 对外演示,不仅包含号码认证的功能,还包含降级短信的功能

Dist

产出物目录,开发环境,生产环境的产出物都会在这里,其中对内测试的也在这里面

Scripts

deploy.js 负责将构建好的 dist 目录上传到 NOS

Src

源代码,入口文件为 Main.js

NPM Scripts

npm run dev

开发环境的构建, 监听文件变化,实时构建