服务器响应状态为429(请求过多)intlTelInput.js

Ana*_*DEV 6 javascript jquery geolocation

我正在使用intlTelInput.min.js通过此代码进行地理IP查找

jQuery("#teephnumber").intlTelInput({
        allowExtensions: true,
        defaultCountry: "auto",
        setNumber: "Telephone number",
        geoIpLookup: function(callback) {
            $.get('http://ipinfo.io', function() {}, "jsonp").always(function(resp) {
              var countryCode = (resp && resp.country) ? resp.country : "";
              callback(countryCode);
            });
          },
        nationalMode: false,
        utilsScript: "/wp-content/themes/imc/js/utils.js"
    });
Run Code Online (Sandbox Code Playgroud)

它工作正常,但现在不在控制台中,我看到此错误:

The server responded with a status of 429 (Too Many Requests), GET http://ipinfo.io/?callback=jQuery1112025137682701461017_1438183879450&_=1438183879451
Run Code Online (Sandbox Code Playgroud)

而且没有JavaScript代码可以正常工作,这可能是什么原因?

Don*_*ply 4

请参阅此处的速率限制: https: //ipinfo.io/developers

“您每天最多只能发出 1,000 个 API 请求。如果您需要发出更多请求,或者需要 SSL 支持,请参阅我们的付费计划。”

我认为您需要为更多请求付费,或者找到一种方法来减少您提出的请求。您可以缓存该位置,这样每个用户只需使用本地存储查询一次。