# weapps-plugin-ynbf-auth

> `const sdk = require('weapps-plugin-ynbf-auth')`

Latest version **1.1.9** (published 2024-04-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install weapps-plugin-ynbf-auth
pnpm add weapps-plugin-ynbf-auth
yarn add weapps-plugin-ynbf-auth
bun add weapps-plugin-ynbf-auth
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.9 |
| Published | 2024-04-23 |
| First published | 2024-04-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 597.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wuguangyuan |
| Maintainers | wuguangyuan |

## Links

- npm: https://www.npmjs.com/package/weapps-plugin-ynbf-auth
- npm.io page: https://npm.io/package/weapps-plugin-ynbf-auth

## Dependencies (3)

- [@wecity/weda-plugin-utils](https://npm.io/package/@wecity/weda-plugin-utils.md) 0.0.3
- [weapps-plugin-idcard-photo](https://npm.io/package/weapps-plugin-idcard-photo.md) ^1.1.4
- [weapps-plugin-ynbf-request](https://npm.io/package/weapps-plugin-ynbf-request.md) ^1.1.9

## Recent versions

- 1.1.9 (latest) — 2024-04-23

## README

# 云南云助扶项目认证SDK特别定制 #


## 一、在app.js中初始化sdk

`const sdk = require('weapps-plugin-ynbf-auth')`

```
  App({
    onLaunch: function () {
      sdk.init({
        appid: '',
        paasid: '',
        tifhost: ''
      })
    }
  })
```

## 二、引入sdk

`const sdk = require('weapps-plugin-ynbf-auth')`

## 三、使用sdk

- 业务应用登录授权，包含手机号-实名/实人整体流程，调取的方法：*sdk.toLogin()*

```
  sdk.toLogin().then(res => {
    // 会返回 authResult:true 表示授权成功
    console.log('登录授权成功---', res)
  })
```


- 查看认证信息，调用会话方法：*sdk.getSession()*

```
sdk.getSession({
  success: res => {
    console.log('获取会话成功返回的数据', res)
  },
  fail: err => {
    console.log('获取会话失败返回的数据', err)
  }
})
```


- 跳转到安全设置页面时，调取的方法：*sdk.toLoginSet()*

```
sdk.toLoginSet().then(res => {
  // 会返回 hasLoginOut:true 表示退出登录
  console.log('退出登录设置完成', res)
})
```

- 调用ocr接口，调取的方法：*sdk.orcApi()*

```
sdk.orcApi({
  file,
  success: res => {
    console.log('sdk返回fail', res)
    wx.hideLoading()
  },
  fail: err => {
    console.log('sdk返回fail', err)
    wx.hideLoading()
  }
})
```

## 四、其他说明
- 该版本仅为云南云助扶项目定制开发，即人群默认是大陆军民
- 因为weapps-plugin-ynbf-auth有引用weapps-plugin-ynbf-request
- 所以weapps-plugin-ynbf-request还是要install的

## 五、版本对应功能说明
- 1.0.0
- 云南云助扶项目搭建和开发
- 手机号登录 - 实名/实名
- 安全设置

- 1.1.0（request的版本号: 1.1.0）
- ocr功能开发

- 1.1.1（request的版本号: 1.1.0）
- 人脸识别方式默认只有反光识别

- 1.1.2（request的版本号: 1.1.0）
- 手机号授权成功后，立马进行认证操作

- 1.1.3（request的版本号: 1.1.0）
- 引入OCR插件

- 1.1.4（request的版本号: 1.1.0）
- 去掉登录字样

- 1.1.5（request的版本号: 1.1.0）
- 更新认证成功的样式、更新OCR插件包到1.1.4版本

- 1.1.6（request的版本号: 1.1.6）
- 实名、实人核验时，身份证和姓名加密

- 1.1.6-1（request的版本号: 1.1.6-1）
- 在1.1.6的基础上，更新到npm上

- 1.1.7（request的版本号: 1.1.7）
- 开发小程序与APP通过手机号互通功能

- 1.1.8（request的版本号: 1.1.8）
- 修复小缺陷：使用ocr插件

- 1.1.9（request的版本号: 1.1.9）
- 代码没修改，因1.1.8版本删除了重新上传1.1.8版本

---
_Source: https://npm.io/package/weapps-plugin-ynbf-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
