提交 57859252 编写于 作者: laizhilong's avatar laizhilong

注册成功去掉计时器,直接登录

上级 0c134b7e
......@@ -214,8 +214,8 @@
closable: true
});
}
// 3s后自动登录
this.countDown(3);
// 自动登录
this.countDown();
}
}).catch((e: any) => {
const data = e.data;
......@@ -236,20 +236,13 @@
}
/**
* 自动登录倒计时
* 自动登录
*/
public countDown(totalTime: any): void {
public countDown(): void {
// 注册时不允许再点击‘确定注册按钮’
if (!this.canClick) return;
this.canClick = false;
this.confirmRegBtnContent = totalTime + 's后自动登录';
// 设置定时器
let clock = window.setInterval(() => {
// 秒数-1
totalTime--;
this.confirmRegBtnContent = totalTime + 's后自动登录';
if (totalTime < 0) {
// 清除定时器
window.clearInterval(clock);
this.confirmRegBtnContent = '登录中...';
// 登录请求
const loginname: any = this.form.loginname;
const password: any = this.form.password;
......@@ -284,11 +277,11 @@
closable: true
});
}
this.canClick = true;
this.confirmRegBtnContent = '确定注册';
});
}
}, 1000)
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册