socialforge/public/javascripts/wechat/app.js

29 lines
773 B
JavaScript
Raw Normal View History

2016-06-12 13:40:14 +08:00
var app = angular.module('wechat', ['ngRoute']);
2016-06-17 18:18:03 +08:00
app.constant('config', {
rootPath: '/assets/wechat/',
rootUrl: '/',
apiUrl: '/api/v1/'
});
2016-06-17 18:18:03 +08:00
2016-06-20 15:21:13 +08:00
app.run(['$rootScope', 'auth', '$location', '$routeParams', function($rootScope, auth, $location, $routeParams){
2016-06-24 09:01:12 +08:00
if(g_redirect_path && g_redirect_path.length>1){
$location.path(g_redirect_path);
g_redirect_path = null;
}
$rootScope.$on('$routeChangeError', function(event, next, current){
if(next && next.templateUrl){
if(!next.templateUrl.endsWith("login.html") && !next.templateUrl.endsWith("reg.html")){
$location.path("/login");
}
}
});
$rootScope.$on('$routeChangeStart', function(event, next, current){
});
}
2016-06-24 13:52:11 +08:00
]);