@@ -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
}