AngularJS报错No 'Access-Control-Allow-Origin' header
报错:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63342' is therefore not allowed access. The response had HTTP status code 403.
解决方式:
angular.module('com.budee.award').controller('formController', function ($scope,$http) {$scope.formData = {};$scope.processForm = function () {console.log("测试一下"+$scope.formData);$http({url:'http://1.iyyren.com/api/prize/111/record/save',method:"POST",headers: {'Content-Type': 'application/x-www-form-urlencoded'},data: $scope.formData})}
});
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
