|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
var app = angular.module('wechat', ['ngRoute','ngCookies']);
|
|
|
|
|
var apiUrl = '/api/v1/';
|
|
|
|
|
var debug = false; //调试标志,如果在本地请置为true
|
|
|
|
|
var debug = true; //调试标志,如果在本地请置为true
|
|
|
|
|
|
|
|
|
|
if(debug===true){
|
|
|
|
|
apiUrl = 'https://www.trustie.net/api/v1/';
|
|
|
|
|
apiUrl = 'http://localhost:3000/api/v1/';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.factory('auth', function($http,$routeParams, $cookies, $q){
|
|
|
|
@ -399,7 +399,7 @@ app.directive('textAutoHeight', function($timeout){
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.config(['$routeProvider',function ($routeProvider) {
|
|
|
|
|
app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProvider) {
|
|
|
|
|
$routeProvider
|
|
|
|
|
.when('/activities', {
|
|
|
|
|
templateUrl: 'activities.html',
|
|
|
|
@ -436,4 +436,22 @@ app.config(['$routeProvider',function ($routeProvider) {
|
|
|
|
|
.otherwise({
|
|
|
|
|
redirectTo: '/activities'
|
|
|
|
|
});
|
|
|
|
|
$httpProvider.interceptors.push('timestampMarker');
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
//loading
|
|
|
|
|
app.factory('timestampMarker', ["$rootScope", function ($rootScope) {
|
|
|
|
|
var timestampMarker = {
|
|
|
|
|
request: function (config) {
|
|
|
|
|
$rootScope.loading = true;
|
|
|
|
|
config.requestTimestamp = new Date().getTime();
|
|
|
|
|
return config;
|
|
|
|
|
},
|
|
|
|
|
response: function (response) {
|
|
|
|
|
// $rootScope.loading = false;
|
|
|
|
|
response.config.responseTimestamp = new Date().getTime();
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return timestampMarker;
|
|
|
|
|
}]);
|
|
|
|
|