前端限制对后端的请求频率

关于限制请求还是有许多方法的,不过查了很多资料还是觉得前端限制最方便简洁且直接

var restrictions = 0;

        if(restrictions == 0){

          restrictions=1

          //对后端进行的请求

          setTimeout(function () {restrictions == 0},5000) //限制为5s

        }else {
          alert("请求过于频繁")
        }

1234567.

原文地址:https://www.cnblogs.com/Crush123/p/13091401.html