|
|
@@ -161,6 +161,41 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
return url;
|
|
|
};
|
|
|
|
|
|
+ app.controller('AuthCtrl', ['$scope', '$window', 'AuthenticationService', 'toaster', 'BaseService', '$modal', function ($scope, $window, AuthenticationService, toaster, BaseService, $modal) {
|
|
|
+ $scope.isAuthed = AuthenticationService.isAuthed(); //AuthenticationService模块在common/下
|
|
|
+
|
|
|
+ AuthenticationService.getAuthentication().success(function (data) {
|
|
|
+ if (data.content) {
|
|
|
+ $scope.userInfo = data.content;
|
|
|
+ }
|
|
|
+ if (data == null || !data.content) {
|
|
|
+ $scope.isAuthed = false;
|
|
|
+ AuthenticationService.redirectSignin();
|
|
|
+ } else {
|
|
|
+ //跳转到手机号码验证
|
|
|
+// checkTel($scope.userInfo);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $scope.logout = function () {
|
|
|
+ $modal.open({
|
|
|
+ templateUrl: 'static/view/user/logout.html',
|
|
|
+ controller: 'LogOutCtrl'
|
|
|
+ }).result.then(function (s) {
|
|
|
+ if (s) {
|
|
|
+ AuthenticationService.logout();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ app.controller('LogOutCtrl', ['$scope', '$modalInstance', function ($scope, $modalInstance) {
|
|
|
+ $scope.close = function (confirm) {
|
|
|
+ $modalInstance.close(confirm);
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
/**
|
|
|
* 项目列表
|
|
|
*/
|
|
|
@@ -190,8 +225,6 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
if ($rootScope.active) {
|
|
|
$scope.active = $rootScope.active;
|
|
|
}
|
|
|
- console.log($scope.active);
|
|
|
- console.log($rootScope.active);
|
|
|
$scope.keyword = '';
|
|
|
|
|
|
/**
|
|
|
@@ -397,7 +430,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
if (data.error) {
|
|
|
toaster.pop('error','操作失败');
|
|
|
}
|
|
|
- loadData();
|
|
|
+ $modalInstance.close();
|
|
|
}, function(){
|
|
|
|
|
|
});
|
|
|
@@ -412,7 +445,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
if (data.error) {
|
|
|
toaster.pop('error', '申请失败,请联系管理员');
|
|
|
}
|
|
|
- loadData();
|
|
|
+ $modalInstance.close();
|
|
|
}, function(response) {
|
|
|
toaster("error", "出现错误");
|
|
|
});
|