this.state = { btnText: ‘获取验证码‘,timer: 5,discodeBtn: false,clearInterval: false } let siv = setInterval(() => { this.setState({ timer: (timer--),btnText: timer,discodeBtn: true },() => { if (timer === 0) { clearInterval(siv); this.setState({ btnText: ‘重新发送‘,discodeBtn: false }) } }); },1000);