npm

zw-ctu-client-sdk

0.1.3 • Public • Published

zw-ctu-client-sdk

风控SDK

使用方式

npm install zw-ctu-client-sdk --save
const ClientSDK = require('zw-ctu-client-sdk')

const sdk = new ClientSDK('服务url', '您的appId', '您的appSecret')

sdk.checkRisk({
  "data": {
    "phone_number": "17800000000",
    "user_id": "12345326232",
    "ip": "125.121.232.219",
    "const_id": "N4RG6TtsY6ILK5ePY6HVtjj12pu5Yi5wnjnbaUI41"
  },
  "eventCode": "test_event_1",
  "flag": "test1"
}).then((resp) => {
  const level = resp.result.riskLevel

  if (level === 'ACCEPT') {
    // 业务代码,当前请求没有风险
  } else if (level === 'REVIEW') {
    // 业务代码,当前请求有一定风险,建议复审
  } else if (level === 'REJECT') {
    // 业务代码,当前请求有风险,建议拒绝
  }
})

设置超时时间

checkRisk第二个参数为超时时间,默认为2000(2秒)

Readme

Keywords

none

Package Sidebar

Install

npm i zw-ctu-client-sdk

Weekly Downloads

1

Version

0.1.3

License

ISC

Unpacked Size

3.54 kB

Total Files

5

Last publish

Collaborators

  • zenxds