Browse Source

暂时没有用到的业务:-但是解决代码里的报错问题

hella_online_20240904
wangyufei 2 months ago
parent
commit
d709c858da
  1. 30
      src/components/Verifition/src/Verify/VerifyPoints.vue

30
src/components/Verifition/src/Verify/VerifyPoints.vue

@ -147,9 +147,8 @@ onMounted(() => {
return false
}
})
const canvas = ref(null)
const timer1 = ref<NodeJS.Timeout | number>(0)
const timer2 = ref<NodeJS.Timeout | number>(0)
const canvasClick = (e) => {
checkPosArr.push(getMousePos(canvas, e))
if (num.value == checkNum.value) {
@ -159,7 +158,7 @@ const canvasClick = (e) => {
checkPosArr.length = 0
checkPosArr.push(...arr)
//
timer1.value = setTimeout(() => {
setTimeout(() => {
// var flag = this.comparePos(this.fontPos, this.checkPosArr);
//
var captchaVerification = secretKey.value
@ -179,13 +178,9 @@ const canvasClick = (e) => {
text.value = t('captcha.success')
bindingClick.value = false
if (mode.value == 'pop') {
timer2.value = setTimeout(() => {
setTimeout(() => {
proxy.$parent.clickShow = false
refresh()
if(timer2.value){
clearTimeout(timer2.value)
timer2.value = 0
}
}, 1500)
}
proxy.$parent.$emit('success', { captchaVerification })
@ -194,33 +189,18 @@ const canvasClick = (e) => {
barAreaColor.value = '#d9534f'
barAreaBorderColor.value = '#d9534f'
text.value = t('captcha.fail')
timer2.value = setTimeout(() => {
setTimeout(() => {
refresh()
if(timer2.value){
clearTimeout(timer2.value)
timer2.value = 0
}
}, 700)
}
})
if(timer1.value){
clearTimeout(timer1.value)
timer1.value = 0
}
}, 400)
}
if (num.value < checkNum.value) {
num.value = createPoint(getMousePos(canvas, e))
}
}
onBeforeUnmount(() => {
if(timer1.value){
clearTimeout(timer1.value)
}
if(timer2.value){
clearTimeout(timer2.value)
}
})
//
const getMousePos = function (obj, e) {
var x = e.offsetX

Loading…
Cancel
Save