|
|
@@ -65,19 +65,36 @@
|
|
|
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();
|
|
|
postAction(getCaptchaCode, {
|
|
|
ticket: res.ticket,
|
|
|
randstr: res.randstr,
|
|
|
phone: that.phone
|
|
|
+ }).then(() => {
|
|
|
+ this.$toast({message: '验证码获取成功'})
|
|
|
+ if (that.isiOS) {
|
|
|
+ window.webkit.messageHandlers.returnVerificationCode.postMessage(res.ret.toString());
|
|
|
+ }
|
|
|
+ if (that.isAndroid) {
|
|
|
+ window.hap.verificationCode(res.ret.toString());
|
|
|
+ }
|
|
|
+ }).catch(data => {
|
|
|
+ this.$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());
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
{
|