weapps-plugin-jingtong-verify 1.4.9 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,2 +1,2 @@
1
1
  # SDK #
2
- 1.4.5
2
+ 1.5.0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "weapps-plugin-jingtong-verify",
3
3
  "pluginName": "weapps-plugin-jingtong-verify",
4
4
  "pluginType": "mp",
5
- "version": "1.4.9",
5
+ "version": "1.5.0",
6
6
  "description": "",
7
7
  "main": "sdk.js",
8
8
  "author": "tongyirenzheng",
@@ -362,15 +362,15 @@ Page({
362
362
  console.log('获取人脸识别失败次数结果')
363
363
  console.log(res)
364
364
  console.log(res.data)
365
- console.log(res.data)
366
- if(res.errcode === 4054 || res.data.times >= 3) {
367
- // 人脸错误次数大于3次,提示
368
- this.setData({
369
- showToOtherModal: true
370
- })
371
- return
372
- }
373
- if (res.data.errcode === 0) {
365
+ if(res.errcode === 0 ) {
366
+ const { data } = res
367
+ if(data.times >= 3){
368
+ // 人脸错误次数大于3次,提示
369
+ this.setData({
370
+ showToOtherModal: true
371
+ })
372
+ return
373
+ }
374
374
  jingtongVerifyRequest.verifyIdcard(this.data.formData).then(res => {
375
375
  console.log('获取身份证二要素核验结果')
376
376
  console.log(res)
@@ -209,21 +209,29 @@ Page({
209
209
  // 接口验证有没有超出限制次数
210
210
  jingtongVerifyRequest.getVerifyLimit(param).then(res => {
211
211
  console.log(res)
212
- const { data } = res
213
- if(data.errcode === 4054){
214
- this.setData({
215
- showToOtherModal: true
216
- })
217
- } else if (data.errcode === 0){
218
- console.log(idCardType)
219
- console.log(idCardType[formData.cid_type])
220
- console.log('来源类型')
221
- console.log(source_type)
222
- if(source_type === '2'){
223
- this.forgotVerify()
212
+ if (res.errcode === 0){
213
+ const { data } = res
214
+ if(data.times >= 3){
215
+ this.setData({
216
+ showToOtherModal: true
217
+ })
224
218
  } else {
225
- this.setPwdVerify()
219
+ console.log(idCardType)
220
+ console.log(idCardType[formData.cid_type])
221
+ console.log('来源类型')
222
+ console.log(source_type)
223
+ if(source_type === '2'){
224
+ this.forgotVerify()
225
+ } else {
226
+ this.setPwdVerify()
227
+ }
226
228
  }
229
+ } else {
230
+ wx.showToast({
231
+ title: res.timeLimit,
232
+ icon: 'none',
233
+ duration: 1500
234
+ })
227
235
  }
228
236
  })
229
237
  }, 100)
@@ -1457,9 +1457,9 @@ function _getVerifyLimit(options) {
1457
1457
  success: res => {
1458
1458
  let { errcode, data } = res.data
1459
1459
  if (errcode !== 0) {
1460
- return reject(JSON.stringify(res.data))
1460
+ return resolve(res.data)
1461
1461
  }
1462
- return resolve(res)
1462
+ return resolve(res.data)
1463
1463
  },
1464
1464
  fail: err => {
1465
1465
  return reject(JSON.stringify(err.data))