|
@@ -10,7 +10,8 @@ const ChangePw = React.createClass({
|
|
|
visible: false,
|
|
|
getCodeButton: false,
|
|
|
checkMobile: false,
|
|
|
- vsCodeSrc: globalConfig.context + '/open/getVCode'
|
|
|
+ vsCodeSrc: globalConfig.context + '/open/getVCode',
|
|
|
+ mCodeText: '获取验证码'
|
|
|
};
|
|
|
},
|
|
|
showModal() {
|
|
@@ -36,20 +37,20 @@ const ChangePw = React.createClass({
|
|
|
this.setState({
|
|
|
visible: false,
|
|
|
});
|
|
|
- message.success('修改成功!马上跳转到登录页面,请重新登录!');
|
|
|
+ message.success('修改成功!3秒后跳转到登录页面,请重新登录!');
|
|
|
setInterval(function () {
|
|
|
$.ajax({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
- url: globalConfig.context + "./login",
|
|
|
+ url: globalConfig.context + "/login",
|
|
|
}).done(function (data) {
|
|
|
- window.location.href = "../login.html"
|
|
|
+ window.location.href = globalConfig.context + "/user/login.html"
|
|
|
});
|
|
|
clearInterval(interval);
|
|
|
}, 3000);
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
|
- }
|
|
|
+ };
|
|
|
}.bind(this));
|
|
|
};
|
|
|
},
|
|
@@ -100,7 +101,21 @@ const ChangePw = React.createClass({
|
|
|
});
|
|
|
clearInterval(interval);
|
|
|
}, 60000);
|
|
|
- }
|
|
|
+ };
|
|
|
+ let i = 59;
|
|
|
+ let countDown = setInterval(function () {
|
|
|
+ _me.setState({
|
|
|
+ mCodeText: '剩余' + i + '秒'
|
|
|
+ });
|
|
|
+ i--;
|
|
|
+ if (i == 0) {
|
|
|
+ clearInterval(countDown);
|
|
|
+ _me.setState({
|
|
|
+ mCodeText: '获取验证码'
|
|
|
+ });
|
|
|
+ };
|
|
|
+ }, 1000);
|
|
|
+ this.reloadVCode();
|
|
|
}.bind(this),
|
|
|
});
|
|
|
}
|
|
@@ -126,7 +141,7 @@ const ChangePw = React.createClass({
|
|
|
</span>
|
|
|
</div>
|
|
|
<div><span>手机验证码:</span><Input className="mixwidth" onChange={this.mcodeChange} />
|
|
|
- <Button onClick={this.getMCode} disabled={this.state.getCodeButton}>获取验证码</Button></div>
|
|
|
+ <Button style={{width:'92px'}} onClick={this.getMCode} disabled={this.state.getCodeButton}>{this.state.mCodeText}</Button></div>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
);
|