|
|
@@ -42,7 +42,8 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
templateUrl: "static/tpl/serve/self/client.html"
|
|
|
}).state('self.saas',{
|
|
|
url: "/saas",
|
|
|
- templateUrl: "static/tpl/serve/self/saas.html"
|
|
|
+ templateUrl: "static/tpl/serve/self/saas.html",
|
|
|
+ controller: 'SaasCtrl'
|
|
|
}).state('self.add',{
|
|
|
url: "/add_user",
|
|
|
templateUrl: "static/tpl/serve/self/add_user.html",
|
|
|
@@ -401,9 +402,9 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
}]);
|
|
|
|
|
|
/*
|
|
|
- * 添加用户权限校验
|
|
|
+ * 添加、注销和绑定用户权限校验
|
|
|
*/
|
|
|
- app.controller('EditUserCtrl',['$scope', 'AuthenticationService', function($scope,AuthenticationService){
|
|
|
+ app.controller('EditUserCtrl',['$scope', 'AuthenticationService', function($scope, AuthenticationService){
|
|
|
$scope.sys = true;
|
|
|
$scope.editUser = function(){
|
|
|
//已登录
|
|
|
@@ -415,7 +416,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
window.location.href="./#/account/user";
|
|
|
}
|
|
|
else
|
|
|
- $scope.sys =false; //非管理员,提示信息
|
|
|
+ $scope.sys =false; //非管理员,当前页面提示信息
|
|
|
});
|
|
|
}
|
|
|
//未登录
|
|
|
@@ -423,7 +424,32 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
window.location.href="signin#/account/user";
|
|
|
}
|
|
|
}
|
|
|
- }]);
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * SAAS申请权限校验
|
|
|
+ */
|
|
|
+ app.controller('SaasCtrl',['$scope', 'AuthenticationService', function($scope,AuthenticationService){
|
|
|
+ $scope.sys = true;
|
|
|
+ $scope.apply = function(){
|
|
|
+ //已登录
|
|
|
+ if(AuthenticationService.isAuthed()){
|
|
|
+ //获取当前登录用户信息,以判断是否为管理员
|
|
|
+ AuthenticationService.getAuthentication().success(function(data) {
|
|
|
+ $scope.user = data;
|
|
|
+ if($scope.user.sys){ //是管理员,页面跳转
|
|
|
+ window.location.href="./#/account/enterprise";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ $scope.sys =false; //非管理员,提示信息
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //未登录
|
|
|
+ else{
|
|
|
+ window.location.href="signin#/account/enterprise";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]);
|
|
|
|
|
|
/**
|
|
|
* 搜索框,回车触发
|