@
roychan @
yov123456 @
GPU 求解决方案。
//----------------keeep alive---------------
function getCookie (name ) {
var arr = document.cookie.match (new RegExp ("(^| )"+name+"=([^;]*)(;|$)"));
if (arr != null )
return unescape (arr[2]);
return null;
}
function webauthkeepalive_fun (username,userip,secret ) {
$.ajax ({
url: 'auth_submit.php?act=keepalive&t=' + Math.random (),
type: 'POST',
data: 'username='+encodeURI (username )+'&userip='+userip+'&secret='+secret,
timeout: 30000,
async:false,
error: ajaxErrorLoad,
success: function (data ) {
var sh = '';
if (data.indexOf ('0#') > -1 ){
$('.login_success_div').hide ();
$('.login_div').show ();
clearTimeout (sh );
}
else{
var arr = data.split ('$');
var time = arr[4];
time = parseInt (time ) * 1000;
if (time > 0 ){
var sh = setTimeout ('webauthkeepalive_fun (\''+arr[0]+'\',\''+arr[2]+'\',\''+arr[3]+'\')',time );
$('#keepalive_Prompt').html ('请在上网期间保持此页面打开');
}else
$('#keepalive_Prompt').html ('');
var arr = data.split ('$');
$('.login_success_div').show ();
$('.login_div').hide ();
$('#login_username').html (arr[0]);
$('#login_time').html (arr[1]);
$('#login_ip').html (arr[2]);
if (arr[5]){
$('#login_duration').html (time_To_hhmmss (parseInt (arr[5])));
$('#login_duration_timer').val (arr[5]);
}
}
}
});
}