Use o JS para julgar 60 segundos para o tempo, primeiro defina uma atualização variável.
Caso contrário, a solicitação é permitida. Após a solicitação, o horário atual é atribuído à atualização do tempo de atualização e do método de implementação específico;
Copie o código do código da seguinte forma:
Usandonamespace ("Biz.AccountCounder") ["CellphoneValidation"] = {
Atualização: 0, // variável
CheckRefreshget: function (timeLimit) // Verifique o tempo, o timelimit é o tempo (unidade segundos) que exige que a solicitação seja introduzida, como: 60
{{
var nowime = new Date ();
Var nowMinitePoint = nowTime.gethours ()*3600+nowtime.getminutes ()*60+nowime.getSeconds ();
If (NowMinitePoint-biz.accountCenter.cellphonevalidation.Refreshtime <Timelimit) <Timelimit)
{{
Retornar falso;
}
Retornar true;
},
RESETRefReshGet: function () // Após o sucesso da solicitação, o método de chamada é redefinido para o horário atual
{{
var nowime = new Date ();
Var nowMinitePoint = nowTime.gethours ()*3600+nowtime.getminutes ()*60+nowime.getSeconds ();
Biz.accountCenter.cellphoneValidation.RefreshTime = NowMinitePoint;
},
DynamicMessage: function (timecond) // O método de contagem regressiva TimeSecond é de quantos segundos começam, como: 60
{{
Var ShowTimmer;
if (ShowTimmer) {
ClearTimeout (ShowTimmer);
}
ifSecond == DynamicValidate.Refreshtimelimit)
{{
var messagerefresh = $.
$ ("#spanRefresh").
$ ("#spanRefresh").
Timecond-;
}
showTimmer = setTimeout (function () {
var messagerefresh = $.
$ ("#spanRefresh").
Timecond-;
if (timecond <0) {
ClearTimeout (ShowTimmer);
$ ("#spanRefresh").
$ ("#spanRefresh").
} Outro {
Biz.accountCenter.cellphonevalidation.dynamicmessage (timecond);
$ ("#spanRefresh").
}
}, 1000);
},
Criar: function (ooj, página, iscancelphone) //
{{
If (! Biz.accountCenter.CellphoneValidation.CheckRefreshget (DynamicValidate.RefreshTimelimit)) // Cada solicitação, o JS verifica o intervalo de tempo dos anos 60 entre o intervalo de tempo dos anos 60.
{{
$ ("#ValiateError"). span> "). show ();
$ ("#MobileWarning").
Retornar;
}
$ .get ("url", dados, function () {{) {
// se for bem -sucedido
Biz.accountCenter.cellphonevalidation.dynamicmessage (dynamicvalidate.refreshtimelimit);
Biz.accountCenter.CellphoneValidation.resetreshget ();
});
}
}