Angularjs 如何消除;访问控制是否允许角度客户端中的原点?

Angularjs 如何消除;访问控制是否允许角度客户端中的原点?,angularjs,Angularjs,表单提交到页面后,重定向到支付网关页面。 成功或失败后,页面将重定向到相应的页面,如 /成败 剧本 $http({ url: "https://secure.payu.in/_payment", method: "GET", }).success(function(data, status, headers, config) { console.log(data) co

表单提交到页面后,重定向到支付网关页面。 成功或失败后,页面将重定向到相应的页面,如 /成败

剧本

 $http({
          url: "https://secure.payu.in/_payment",
          method: "GET",
          }).success(function(data, status, headers, config) {
                console.log(data)
                 console.log(status)
           }).error(function(data, status, headers, config) {
                    $scope.status = status;
                    console.log(status)
           });
$scope.payemntProceed=function(checkout){
$scope.payment.txnid=Math.floor(100000000000+(Math.random()*900000000000));
$scope.payment.salt="HseUIoSb"
$scope.payment.key="WHlKGc";
$scope.payment.amount=1;
$scope.payment.productinfo=$rootScope.cartlist
$scope.payment.firstname=$rootScope.userinfo.name;
$scope.payment.email=$rootScope.userinfo.email
$scope.payment.phone=$rootScope.userinfo.contactno;
$scope.payment.surl="http://localhost/august1stZustshop/#/home"
$scope.payment.furl="http://localhost/august1stZustshop/#/checkout"
$scope.payment.service_provider="payu_paisa"
var string = $scope.payment.key + '|' + $scope.payment.txnid + '|' + $scope.payment.amount + '|' + $scope.payment.productinfo + '|' + $scope.payment.firstname + '|' + $scope.payment.email + '|||||||||||' + $scope.payment.salt;
$scope.payment.hash = $scope.SHA512(string);
}
控制台显示如下:

XMLHttpRequest cannot load https://secure.payu.in/_payment.
No 'Access-   Control-Allow-Origin' header is present on the requested resource. 
Origin 'http://localhost' is therefore not allowed access.
status is -1.
它总是执行失败代码。显示状态为-1

form.html

<form action="https://secure.payu.in/_payment" method="post" ng-submit="payemntProceed(checkout)">
 <input type="text" ng-model="payment.txnid"  name="txnid" >
 <input type="text" ng-model="payment.key"  name="key" >
 <input type="text" ng-model="payment.amount"  name="amount" >       
 <input type="text" ng-model="payment.productinfo"  name="productinfo" >
 <input type="text" ng-model="payment.firstname" name="firstname" >
 <input type="text" ng-model="payment.email"  name="email" >
 <input type="text" ng-model="payment.phone"  name="phone" >         
 <input type="text" ng-model="payment.hash" name="hash" >
 <input type="text" ng-model="payment.surl"  name="surl" >
 <input type="text" ng-model="payment.furl"  name="furl">
 <input type="text" ng-model="payment.service_provider"  name="service_provider">
 <button type="submit">submit</button>

提交

请告诉我如何消除交叉源问题。我正在使用payu money支付网关。

在仍然发出请求的情况下,阻止客户端出现XHR交叉源错误的唯一方法是不使用XHR


摆脱调用
$http
的JavaScript,并正常提交表单。

停止客户端XHR跨源错误的唯一方法是不使用XHR,同时仍发出请求


摆脱调用
$http
的JavaScript并正常提交表单。

使用正常表单提交接受POST方法。

使用正常表单提交接受POST方法。

请提供文章或链接。@SrinivasAppQube-为什么需要文章来停止您已经做的事情?我正在使用正常表单提交提交页面无法重定向到支付网关?@SrinivasAppQube-您没有使用正常提交。您正在运行一些JavaScript,然后使用$http函数来执行此操作。它与您的一样…但没有JavaScript。请提供文章或链接。@SrinivasAppQube-为什么您需要一篇文章来停止您已经做过的事情?我使用的是普通提交页面无法重定向到支付网关?@SrinivasAppQube-您没有使用正常的提交。您正在运行一些JavaScript,然后使用$http函数来执行此操作。它与您的一样……但没有JavaScript。