阅读背景:

如何将routeProvider代码更改为stateProvider(ui-router)代码?

来源:互联网 

I have this code:

我有这个代码:

app.run(function($rootScope, $location, $window, AuthenticationService) {
        $rootScope.$on("$routeChangeStart", function(event, nextRoute, currentRoute) {
            //redirect only if both isAuthenticated is false and no token is set
            if (nextRoute != null && nextRoute.access != null && nextRoute.access.requiredAuthentication 
                && !AuthenticationService.isAuthenticated && !$window.sessionStorage.token) {

                $location.path("/admin/login");
            }
        });
    });
app.run(function(



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: