diff --git a/src/renderer/src/views/login/index.vue b/src/renderer/src/views/login/index.vue index 6a76a52..9b506aa 100644 --- a/src/renderer/src/views/login/index.vue +++ b/src/renderer/src/views/login/index.vue @@ -38,7 +38,7 @@ - 发送验证码 + {{ codeName }} @@ -64,7 +64,7 @@ width="500" style=" -webkit-app-region: no-drag;" > - 根据图片回答相关问题 + 根据图片回答相关问题1
@@ -162,6 +162,14 @@ const sbmitImg=()=>{ ElMessage.success('短信发送成功') ruleForm.Code=res.data isImg.value=false + codeName.value=60 + timer.value=setInterval(()=>{ + codeName.value-- + if(codeName.value==0){ + codeName.value='发送验证码' + clearInterval(timer.value); + } + },1000) } }) @@ -182,14 +190,14 @@ const sendyzm=()=>{ isPeopleImg.value='data:image/jpg;base64,'+res.img isImg.value=true resImg.imgData=res - codeName.value=60 - timer.value=setInterval(()=>{ - codeName.value-- - if(codeName.value==0){ - codeName.value='发送验证码' - clearInterval(timer.value); - } - },1000) + // codeName.value=60 + // timer.value=setInterval(()=>{ + // codeName.value-- + // if(codeName.value==0){ + // codeName.value='发送验证码' + // clearInterval(timer.value); + // } + // },1000) }else{ ElMessage.error(res.msg) } @@ -278,6 +286,9 @@ const setCookie = (name, value) => { } const gotoLogin = () => { codeName.value='发送验证码' + if (timer.value){ + clearInterval(timer.value); + } if (ruleFormRef.value) ruleFormRef.value.resetFields() isRegister.value = true }