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

aliyun_numberauthsdk_web

v2.1.9

Published

号码认证服务

Downloads

328

Readme

号码认证h5

提供三网号码认证功能

项目启动

 tnpm install    // 安装依赖
 tnpm start    // 项目启动

 tnpm run build  // 打包

接口说明

  • 初始化实例
// 初始化实例
const { PhoneNumberServer } = window;
this.phoneNumberServer = new PhoneNumberServer();
  • 设置SDK是否开启日志(开启后会在控制台打印更多内容便于排查问题)
this.phoneNumberServer.setLoggerEnable();

参数说明

| 参数名称 | 参数说明 | | --- | --- | --- | | isEnable | 是否开启 true/false|

  • 获取号码认证sdk版本号
const sdkVersion = this.phoneNumberServer.getVersion();  // 返回sdk版本号 eg: '1.0.0'
  • 身份鉴权
this.phoneNumberServer.checkAuthAvailable({
    phoneNumber: '151********', // 非必输项
    accessToken: 'XXXXXXXXxx',
    jwtToken:'******',
    success:function(res){
      console.log(res.jwtToken);
      console.log(res.accessToken);
    },

    error: function(res){

    }

});

| 参数名称 | 参数说明 | | --- | --- | --- | | phoneNumber | 本机号码(非必输项) | | accessToke | 号码认证业务鉴权token(由阿里云对外暴露的getToken 接口生成) | jwtToken | API网关认证token(由阿里云对外暴露的getToken 接口生成) | | success | 成功回调| | error | 失败回调|

  • 获取本机号码校验token
this.phoneNumberServer.getVerifyToken({
    success:function(res){
      console.log(res)

    },

    error: function(res){

    }

});

| 参数名称 | 参数说明 | | --- | --- | --- | | success | 成功回调| | error | 失败回调|

  • 返回值说明

| 参数名称 | 参数说明 | | --- | --- | --- | | code | 成功6000(其他详见错误码) | | spToken | 运营商token | | content | 失败时运营商返回的内容 |

  • 错误码说明

| 返回码 | 返回码说明 | | --- | --- | --- | | 600000 | 成功的返回code | | 600010 | 未知异常| | 600011 | 获取token失败| | 600013 | 运营商维护升级,该功能不可用 | | 600014 | 运营商维护升级,该功能已达最大调用次数| | 600015 | 接口超时 | | 600025 | 接入方身份信息校验失败 | | 600008 | 环境错误(未在蜂窝网络下使用或未使用手机浏览器)|