Commit 1585d6e1 authored by nanahira's avatar nanahira

refresh vaptcha obj

parent f50e37f5
Pipeline #28212 canceled with stages
in 18 seconds
......@@ -23,14 +23,16 @@ async function checkStatus(response) {
}
let vaptchaObj = null;
vaptcha({
function refreshVaptchaObject() {
vaptcha({
vid: '668bf0efd3784602950e94a8',
type: 'invisible',
scene: 0,
area: 'auto',
}).then((v) => {
}).then((v) => {
vaptchaObj = v;
});
});
}
/**
* Requests a URL, returning a promise.
......@@ -52,11 +54,12 @@ export default function request(relativeUrl, options) {
'x-vaptcha-token': token.token,
};
request(relativeUrl, options).then(resolve).catch(reject);
vaptchaObj.reset();
refreshVaptchaObject();
});
vaptchaObj.listen('close', () => {
console.log('vaptcha close');
reject(new Error('vaptcha close'));
refreshVaptchaObject();
})
vaptchaObj.validate();
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment