fix cleartimeout & vistor expire

This commit is contained in:
xuecong 2021-11-19 16:19:54 +08:00
parent 92e5ef1e3f
commit 757342a670
2 changed files with 6 additions and 1 deletions

View File

@ -64,7 +64,7 @@ const MpVistorCreateAction = <Action>{
{
name: 'expire',
regex: /^\d{13}$/,
validator: val => Date.now() < val,
validator: val => Date.now() < moment(val).endOf('day').valueOf(),
required: true
}
]

View File

@ -153,6 +153,8 @@ export default {
this.state = res.data.state;
this.ready = true;
clearTimeout(this.stateTimer);
this.stateTimer = setTimeout(() => {
this.expired = true;
}, res.data.expire);
@ -163,6 +165,9 @@ export default {
.get('/user/captcha')
.then(res => {
this.captchaImg = res.data.img;
clearTimeout(this.capatchTimer);
this.capatchTimer = setTimeout(() => {
this.getCaptcha();
}, res.data.expire);