fix cleartimeout & vistor expire
This commit is contained in:
parent
92e5ef1e3f
commit
757342a670
@ -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
|
||||
}
|
||||
]
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user