小编afa*_*aus的帖子

reCaptcha问题:请求的资源上没有'Access-Control-Allow-Origin'标头,即使我在angularJS中添加了标题,也始终显示

我在谷歌reCaptcha有一些问题验证码很好,它正常显示,但当我提交它时,我发送POST请求时有连接问题

https://www.google.com/recaptcha/api/verify

这里的错误日志:

XMLHttpRequest cannot load https://www.google.com/recaptcha/api/verify. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3002' is therefore not allowed access. The response had HTTP status code 405.
Run Code Online (Sandbox Code Playgroud)

这里是我的HTML代码:

<div class="form-group" style="margin-bottom: 20px;">
    <div class="text-center center-block">
      <div class="text-center center-block" vc-recaptcha
      tabindex="3"
      theme="white"
      key="model.key"
      lang="en"
           </div>
    <button class="btn" ng-click="submit()">Submit</button>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

这是我的controller.js

 $scope.model = {
            key: //THIS IS MY PUBLIC KEY
        };
 $scope.submit = function() {

            var valid;
            var ip;
            $http.jsonp('http://ipinfo.io/?callback=JSON_CALLBACK')
                    .success(function(data) {
                        console.log("stateChangeStart ip = " + data.ip); …
Run Code Online (Sandbox Code Playgroud)

recaptcha angularjs

9
推荐指数
2
解决办法
1万
查看次数

标签 统计

angularjs ×1

recaptcha ×1