You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by zh...@apache.org on 2015/12/15 18:03:42 UTC

kylin git commit: KYLIN-1236 redirect to home page when input invalid url

Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 4ca4c3248 -> 951d6ece7


KYLIN-1236 redirect to home page when input invalid url


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/951d6ece
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/951d6ece
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/951d6ece

Branch: refs/heads/2.x-staging
Commit: 951d6ece79b2ee2155ab4e72450ba3d343bb302c
Parents: 4ca4c32
Author: jian <ji...@apache.org>
Authored: Wed Dec 16 01:03:24 2015 +0800
Committer: jian <ji...@apache.org>
Committed: Wed Dec 16 01:03:24 2015 +0800

----------------------------------------------------------------------
 webapp/app/js/config.js    | 2 +-
 webapp/app/js/listeners.js | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/951d6ece/webapp/app/js/config.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/config.js b/webapp/app/js/config.js
index cf3ea6d..46fdecd 100644
--- a/webapp/app/js/config.js
+++ b/webapp/app/js/config.js
@@ -56,7 +56,7 @@ KylinApp.config(function ($routeProvider, $httpProvider, $locationProvider, $log
 
   // Loop over routes and add to router.
   angular.forEach(Config.routes, function (route) {
-    $routeProvider.when(route.url, route.params);
+    $routeProvider.when(route.url, route.params).otherwise({redirectTo:'/'});
   });
 
   // Set to use HTML5 mode, which removes the #! from modern browsers.

http://git-wip-us.apache.org/repos/asf/kylin/blob/951d6ece/webapp/app/js/listeners.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/listeners.js b/webapp/app/js/listeners.js
index 08a9bf9..2a01fff 100644
--- a/webapp/app/js/listeners.js
+++ b/webapp/app/js/listeners.js
@@ -27,6 +27,9 @@ KylinApp.run(function ($rootScope, $http, $location, UserService, Authentication
 
   $rootScope.$on("$routeChangeStart", function () {
     AuthenticationService.ping(function (data) {
+      if(!data.userDetails){
+        $location.path(UserService.getHomePage());
+      }
       UserService.setCurUser(data);
     });