Giter VIP home page Giter VIP logo

quickpass-h5-demo's Introduction

本机校验H5使用手册

引入SDK

  1. npm引入
  npm install --save netease-quickpass-sdk
  1. script引入

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

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

注意: 生产上有https访问的,https请求跨域,会导致上报的referer为空,请在head中添加代码:

  <meta content="origin" name="referrer">

或者

  <meta content="origin-when-cross-origin" name="referrer">

初始化

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

timeout -- getToken超时时间

获取秘钥

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

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

上传秘钥

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

quickpass-h5-demo's People

Contributors

yd-dev 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.