我在谷歌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)