You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
811 B
30 lines
811 B
var app = angular.module('wechat', ['ngRoute']);
|
|
|
|
app.constant('config', {
|
|
rootPath: '/assets/wechat/',
|
|
rootUrl: '/',
|
|
apiUrl: '/api/v1/'
|
|
});
|
|
|
|
|
|
app.run(['$rootScope', 'auth', '$location', '$routeParams', function($rootScope, auth, $location, $routeParams){
|
|
|
|
if(g_redirect_path && g_redirect_path.length>1){
|
|
console.log(g_redirect_path);
|
|
$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){
|
|
});
|
|
}
|
|
]); |