wangxin 5 роки тому
батько
коміт
35bf2c7c51
1 змінених файлів з 6 додано та 30 видалено
  1. 6 30
      src/view/captcha/captcha.vue

+ 6 - 30
src/view/captcha/captcha.vue

@@ -65,42 +65,18 @@
             this.TencentCaptcha = new window.TencentCaptcha(
                 getAppId(process.env.NODE_ENV),
                 function (res) {/* callback */
+                    if (that.isiOS) {
+                        window.webkit.messageHandlers.returnVerificationCode.postMessage(res.ret.toString());
+                    }
+                    if (that.isAndroid) {
+                        window.hap.verificationCode(res.ret.toString());
+                    }
                     if (res.ret === 0) {
-                        // that.countDown();
-                        if (that.isiOS) {
-                            window.webkit.messageHandlers.returnVerificationCode.postMessage(res.ret.toString());
-                        }
-                        if (that.isAndroid) {
-                            window.hap.verificationCode(res.ret.toString());
-                        }
                         postAction(getCaptchaCode, {
                             ticket: res.ticket,
                             randstr: res.randstr,
                             phone: that.phone
-                        }).then(() => {
-                            that.$toast({message: '验证码获取成功'})
-                            if (that.isiOS) {
-                                window.webkit.messageHandlers.returnVerificationCode.postMessage(res.ret.toString());
-                            }
-                            if (that.isAndroid) {
-                                window.hap.verificationCode(res.ret.toString());
-                            }
-                        }).catch(data => {
-                            that.$toast.fail({icon: 'close', message: data.errmsg})
-                            if (that.isiOS) {
-                                window.webkit.messageHandlers.returnVerificationCode.postMessage(res.ret.toString());
-                            }
-                            if (that.isAndroid) {
-                                window.hap.verificationCode(res.ret.toString());
-                            }
                         })
-                    } else {
-                        if (that.isiOS) {
-                            window.webkit.messageHandlers.returnVerificationCode.postMessage(res.ret.toString());
-                        }
-                        if (that.isAndroid) {
-                            window.hap.verificationCode(res.ret.toString());
-                        }
                     }
                 },
                 {