|
@@ -53,8 +53,24 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
|
|
+ var container = document.querySelector("body")
|
|
|
|
|
+ container.addEventListener('DOMSubtreeModified', function () {
|
|
|
|
|
+ const element = document.querySelector('#tcaptcha_transform')
|
|
|
|
|
+ const t_verify = document.querySelector('#t_verify')
|
|
|
|
|
+ const mask = document.querySelector('.t-mask')
|
|
|
|
|
+ if (mask) {
|
|
|
|
|
+ mask.style.display = 'none'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (t_verify) {
|
|
|
|
|
+ t_verify.style.border = 'none'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (element) {
|
|
|
|
|
+ element.style.border = 'none'
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }, false);
|
|
|
document.querySelector('iframe').onload = function () {
|
|
document.querySelector('iframe').onload = function () {
|
|
|
- document.querySelector('.t-mask').style.display = 'none'
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.isAndroid = /(Android)/i.test(navigator.userAgent)
|
|
this.isAndroid = /(Android)/i.test(navigator.userAgent)
|
|
@@ -65,18 +81,35 @@
|
|
|
this.TencentCaptcha = new window.TencentCaptcha(
|
|
this.TencentCaptcha = new window.TencentCaptcha(
|
|
|
getAppId(process.env.NODE_ENV),
|
|
getAppId(process.env.NODE_ENV),
|
|
|
function (res) {/* callback */
|
|
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) {
|
|
if (res.ret === 0) {
|
|
|
postAction(getCaptchaCode, {
|
|
postAction(getCaptchaCode, {
|
|
|
ticket: res.ticket,
|
|
ticket: res.ticket,
|
|
|
randstr: res.randstr,
|
|
randstr: res.randstr,
|
|
|
phone: that.phone
|
|
phone: that.phone
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ that.$toast.fail({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());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|