var requestAdd = true; $scope.submit = function () { if (!requestAdd) { // 防止恶意用户频繁提交 setTimeout(function() { requestAdd = false; }, 3000); tips.text('请勿重复提交!'); return; } $flag=Validator(); if($flag){ requestAdd = false; }