Configure http provider
This commit is contained in:
parent
bd81674a85
commit
cfe4616c4a
2 changed files with 11 additions and 4 deletions
|
@ -6,9 +6,11 @@
|
||||||
var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize']);
|
var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure the router
|
* Configure routeProvider
|
||||||
*/
|
*/
|
||||||
mainApp.config(['$routeProvider', function($routeProvider){
|
mainApp.config(['$routeProvider', function($routeProvider){
|
||||||
|
|
||||||
|
|
||||||
$routeProvider.
|
$routeProvider.
|
||||||
when('/home',{
|
when('/home',{
|
||||||
templateUrl: 'partials/home/main.html',
|
templateUrl: 'partials/home/main.html',
|
||||||
|
@ -22,5 +24,11 @@ mainApp.config(['$routeProvider', function($routeProvider){
|
||||||
});
|
});
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure httpProvider
|
||||||
|
*/
|
||||||
|
mainApp.config(['$httpProvider', function($httpProvider){
|
||||||
|
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
|
||||||
|
|
||||||
|
}]);
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,7 @@ identity.requestParser = {};
|
||||||
*/
|
*/
|
||||||
identity.request.login=function($http,username, password,projectname){
|
identity.request.login=function($http,username, password,projectname){
|
||||||
return $http.post('../server/index.php',
|
return $http.post('../server/index.php',
|
||||||
$.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}),
|
$.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}));
|
||||||
{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue