Fixed #4671

This was an issue with the api url in the angular code.
parent e7d7abf6
......@@ -9,7 +9,8 @@
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="bower_components/bootswatch/superhero/bootstrap.css">
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.css">
<!-- endbuild -->
<!-- build:js scripts/modernizr.js -->
......
......@@ -25,9 +25,10 @@ var archivingPortalClient = angular.module('archivingPortalClient',
'archivingPortalClient.projectService'
]);
archivingPortalClient.run(function ($rootScope) {
$rootScope.portalApiUrl = "http://localhost:8080/";
});
/**
* Set the API host ip.
*/
archivingPortalClient.constant('portalApiUrl', 'http://129.177.92.196:8080/');
/**
* Define all routes, partials and controllers in the application.
......@@ -60,7 +61,6 @@ archivingPortalClient.factory('authHttpResponseInterceptor',['$q','$location','$
response: function(response){
if (response.status === 401) {
$log.error("Response 401");
//$rootScope.oauth.access_token = "";
}
return response || $q.when(response);
},
......
'use strict';
var MainController = function($scope, User, LoginService, TokenService) {
var MainController = function($scope, $log, User, LoginService, TokenService) {
//Login Form.
$scope.login = {};
......
......@@ -6,10 +6,10 @@ var loginService = angular.module('archivingPortalClient.loginService', ['ngReso
* Logs a user in using basic authentication to request access to the
* oauth2 token endpoint.
*/
loginService.factory('LoginService', function ($resource, $http) {
loginService.factory('LoginService', function ($resource, $http, portalApiUrl) {
$http.defaults.headers.common['Authorization'] = 'Basic aHRtbDUtYXJjaGl2aW5ncG9ydGFsOjEyMzQ1Ng==';
return $resource(apiUrl+'oauth/token', {}, {
return $resource(portalApiUrl+'oauth/token', {}, {
save: {
params:{
password:'@password',
......
......@@ -2,12 +2,11 @@
var nationService = angular.module('archivingPortalClient.nationService', ['ngResource']);
var apiUrl = 'http://localhost:8080/';
var nationAll = 'nation/list';
nationService.factory('Nations', ['$resource',
function($resource) {
return $resource(apiUrl+nationAll, {}, [{
nationService.factory('Nations', ['$resource', 'portalApiUrl',
function($resource, portalApiUrl) {
return $resource(portalApiUrl+nationAll, {}, [{
query:{
//params can go here if we got any.
}
......
......@@ -2,9 +2,9 @@
var projectService = angular.module('archivingPortalClient.projectService', ['ngResource']);
userService.service('ProjectList', ['$resource',
function($resource) {
return $resource(apiUrl+'project/list', {}, {
userService.service('ProjectList', ['$resource', 'portalApiUrl',
function($resource, portalApiUrl) {
return $resource(portalApiUrl+'project/list', {}, {
query:{
size: '@size',
page: '@page'
......
......@@ -2,9 +2,10 @@
var userService = angular.module('archivingPortalClient.userService', ['ngResource']);
userService.factory('User', ['$resource',
function($resource) {
return $resource(apiUrl+'user', {}, {
userService.factory('User', ['$resource', 'portalApiUrl',
function($resource, portalApiUrl) {
console.log(portalApiUrl);
return $resource(portalApiUrl+'user', {}, {
query:{
//params can go here if we got any.
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment