📅  最后修改于: 2022-03-11 14:53:47.596000             🧑  作者: Mango
function pageRange(page,pageCount){
var start = page-2,
end = page+2;
if(end>pageCount){
start-=(end-pageCount);
end=pageCount;
}
if(start<=0){
end+=((start-1)*(-1));
start=1;
}
end = end>pageCount?pageCount:end;
return {start:start, end:end};
}