This repository was archived by the owner on Dec 24, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +27
-7
lines changed Expand file tree Collapse file tree 5 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 4
4
angular . module ( 'myApp' , [
5
5
'ngRoute' ,
6
6
'http-auth-interceptor' ,
7
+ 'ui.bootstrap' ,
8
+ 'myApp.relog' ,
7
9
'myApp.view1' ,
8
10
'myApp.view2' ,
9
11
'myApp.logout' ,
10
12
'myApp.version'
11
13
] ) .
12
14
config ( [ '$routeProvider' , function ( $routeProvider ) {
13
15
$routeProvider . otherwise ( { redirectTo : '/view1' } ) ;
14
- } ] ) . run ( function ( $rootScope , $window ) {
16
+ } ] ) . run ( function ( $rootScope , $modal ) {
15
17
16
18
// Call when the 401 response is returned by the server
17
19
$rootScope . $on ( 'event:auth-loginRequired' , function ( rejection ) {
18
- $window . alert ( "Session timeout, will restart..." ) ;
19
- $window . location . reload ( ) ;
20
+ $modal . open ( { templateUrl : 'relog/relog.html' , controller : 'RelogCtrl' , backdrop : false } ) ;
20
21
} ) ;
21
22
22
23
} ) ;
Original file line number Diff line number Diff line change 9
9
< title > My AngularJS App</ title >
10
10
< meta name ="description " content ="">
11
11
< meta name ="viewport " content ="width=device-width, initial-scale=1 ">
12
- < link rel ="stylesheet " href ="bower_components/html5-boilerplate/css/normalize.css ">
13
- < link rel ="stylesheet " href ="bower_components/html5-boilerplate/css/main.css ">
12
+ < link rel ="stylesheet " href ="bower_components/bootstrap/dist/css/bootstrap.min.css ">
14
13
< link rel ="stylesheet " href ="app.css ">
15
- < script src ="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js "> </ script >
16
14
</ head >
17
15
< body >
18
16
< ul class ="menu ">
33
31
<script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script>
34
32
-->
35
33
< script src ="bower_components/angular/angular.js "> </ script >
34
+ < script src ="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js "> </ script >
36
35
< script src ="bower_components/angular-route/angular-route.js "> </ script >
37
36
< script src ="bower_components/angular-http-auth/src/http-auth-interceptor.js "> </ script >
38
37
< script src ="app.js "> </ script >
39
38
< script src ="view1/view1.js "> </ script >
40
39
< script src ="view2/view2.js "> </ script >
41
40
< script src ="logout/logout.js "> </ script >
41
+ < script src ="relog/relog.js "> </ script >
42
42
< script src ="components/version/version.js "> </ script >
43
43
< script src ="components/version/version-directive.js "> </ script >
44
44
< script src ="components/version/interpolate-filter.js "> </ script >
Original file line number Diff line number Diff line change
1
+ < div class ="modal-header ">
2
+ < h3 class ="modal-title "> Session timeout</ h3 >
3
+ </ div >
4
+ < div class ="modal-body ">
5
+ Please re-log
6
+ </ div >
7
+ < div class ="modal-footer ">
8
+ < button class ="btn btn-primary " ng-click ="relog() "> Relog</ button >
9
+ </ div >
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ angular . module ( 'myApp.relog' , [ ] )
4
+
5
+ . controller ( 'RelogCtrl' , function ( $scope , $window ) {
6
+ $scope . relog = function ( ) {
7
+ $window . location = "index.php" ;
8
+ }
9
+ } ) ;
Original file line number Diff line number Diff line change 11
11
"angular-loader" : " 1.2.x" ,
12
12
"angular-mocks" : " ~1.2.x" ,
13
13
"angular-http-auth" : " 1.2.x" ,
14
- "html5-boilerplate" : " ~4.3.0"
14
+ "angular-bootstrap" : " *" ,
15
+ "bootstrap" : " 3.x"
15
16
}
16
17
}
You can’t perform that action at this time.
0 commit comments