fix cleartimeout & vistor expire
This commit is contained in:
parent
92e5ef1e3f
commit
757342a670
@ -64,7 +64,7 @@ const MpVistorCreateAction = <Action>{
|
|||||||
{
|
{
|
||||||
name: 'expire',
|
name: 'expire',
|
||||||
regex: /^\d{13}$/,
|
regex: /^\d{13}$/,
|
||||||
validator: val => Date.now() < val,
|
validator: val => Date.now() < moment(val).endOf('day').valueOf(),
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -153,6 +153,8 @@ export default {
|
|||||||
this.state = res.data.state;
|
this.state = res.data.state;
|
||||||
this.ready = true;
|
this.ready = true;
|
||||||
|
|
||||||
|
clearTimeout(this.stateTimer);
|
||||||
|
|
||||||
this.stateTimer = setTimeout(() => {
|
this.stateTimer = setTimeout(() => {
|
||||||
this.expired = true;
|
this.expired = true;
|
||||||
}, res.data.expire);
|
}, res.data.expire);
|
||||||
@ -163,6 +165,9 @@ export default {
|
|||||||
.get('/user/captcha')
|
.get('/user/captcha')
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.captchaImg = res.data.img;
|
this.captchaImg = res.data.img;
|
||||||
|
|
||||||
|
clearTimeout(this.capatchTimer);
|
||||||
|
|
||||||
this.capatchTimer = setTimeout(() => {
|
this.capatchTimer = setTimeout(() => {
|
||||||
this.getCaptcha();
|
this.getCaptcha();
|
||||||
}, res.data.expire);
|
}, res.data.expire);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user