Commit ee0b468b authored by zhangyanni's avatar zhangyanni

邮箱登录禁止重复提交

parent a777570c
......@@ -43,7 +43,7 @@
<sliderCmpt @sendVerification="getVerification"></sliderCmpt>
</el-form-item>
<el-form-item>
<el-button type="primary" class="loginButton" @click="handleLogin(2,'emailYzCodeForm')">登录
<el-button type="primary" class="loginButton" :disabled="flag>0" @click="handleLogin(2,'emailYzCodeForm')">登录
</el-button>
</el-form-item>
<el-form-item class="registerButton">
......@@ -93,7 +93,8 @@
sliderSuccess:false,
timer:null,
showCount:true,
count:''
count:'',
flag:0,
}
},
methods:{
......@@ -152,26 +153,49 @@
apiurl(params).then((res)=>{
if(res.code==0){
that.$router.replace("/dashboard");
setTimeout(function(){
that.flag = 0;
return false;
},500)
}else{
that.$message.error(res.msg);
setTimeout(function(){
that.flag = 0;
return false;
},500)
}
}).catch((err)=>{
that.$message.error(err);
setTimeout(function(){
that.flag = 0;
return false;
},500)
})
},
//登录
handleLogin(type,formName){
const that =this;
let params;
this.$refs[formName].validate((valid) => {
if (valid) {
if(type==1) that.isCheckedPassword(); //1密码登录 2验证码登录
that.submitLoginFormFunc(type);
} else {
if(this.flag==0){
this.flag++;
this.$refs[formName].validate((valid) => {
if (valid) {
if(type==1) that.isCheckedPassword(); //1密码登录 2验证码登录
that.submitLoginFormFunc(type);
} else {
setTimeout(function(){
that.flag = 0;
return false;
},500)
}
});
}else{
setTimeout(function(){
that.flag = 0;
return false;
}
});
},500)
}
},
//读取cookie
......
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