weapps-plugin-jingtong-verify 1.4.9 → 1.5.1

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.1
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.1",
6
6
  "description": "",
7
7
  "main": "sdk.js",
8
8
  "author": "tongyirenzheng",
@@ -362,19 +362,21 @@ 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
+ wx.hideLoading()
369
+ // 人脸错误次数大于3次,提示
370
+ this.setData({
371
+ showToOtherModal: true
372
+ })
373
+ return
374
+ }
374
375
  jingtongVerifyRequest.verifyIdcard(this.data.formData).then(res => {
375
376
  console.log('获取身份证二要素核验结果')
376
377
  console.log(res)
377
378
  if(res.errcode === 0){
379
+ wx.hideLoading()
378
380
  // 可以进行人脸
379
381
  this.faceVerifyIng()
380
382
  } else {
@@ -209,21 +209,32 @@ 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
+ wx.hideLoading()
216
+ this.setData({
217
+ showToOtherModal: true
218
+ })
224
219
  } else {
225
- this.setPwdVerify()
220
+ console.log(idCardType)
221
+ console.log(idCardType[formData.cid_type])
222
+ console.log('来源类型')
223
+ console.log(source_type)
224
+ wx.hideLoading()
225
+ if(source_type === '2'){
226
+ this.forgotVerify()
227
+ } else {
228
+ this.setPwdVerify()
229
+ }
226
230
  }
231
+ } else {
232
+ wx.hideLoading()
233
+ wx.showToast({
234
+ title: res.timeLimit,
235
+ icon: 'none',
236
+ duration: 1500
237
+ })
227
238
  }
228
239
  })
229
240
  }, 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))