nginx Angular js隐藏http url

时间:2016-11-28 05:46:23

标签: javascript jquery angularjs nginx

我怎样才能在角js中隐藏我的http网址。 让我们说我不想展示https://www.example.com/api/v1/page。在下面的片段中 如果我们无法隐藏,有没有办法加密它。 在此先感谢!!

 myApp.service('dataService', function($http,$q) {
                     delete $http.defaults.headers.common['X-Requested-With'];
                     this.getData = function() {
                        deferred = $q.defer();
                        $http({
                            method: 'GET',
                            url: 'https://www.example.com/api/v1/page',
                            params: 'limit=10, sort_by=created:desc',
                            headers: {'Authorization': 'Token token=xxxxYYYYZzzz'}
                        }).success(function(data){
                            // With the data succesfully returned, we can resolve promise and we can access it in controller
                            deferred.resolve();
                        }).error(function(){
                             alert("error");
                             //let the function caller know the error
                             deferred.reject(error);
                        });
                        return deferred.promise;
                     }
                   });

0 个答案:

没有答案