|
|
@@ -7,12 +7,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
app.config(['$httpProvider', function ($httpProvider) {
|
|
|
// http拦截
|
|
|
$httpProvider.interceptors.push('httpInterceptor');
|
|
|
+
|
|
|
}]);
|
|
|
- app.factory('httpInterceptor', ['$window', '$q', 'SessionService', function ($window, $q, SessionService) {
|
|
|
+ app.factory('httpInterceptor', ['$window', '$q', function ($window, $q) {
|
|
|
+ var session = $window.sessionStorage;
|
|
|
var httpInterceptor = {
|
|
|
'responseError': function (response) {
|
|
|
- var authorized = SessionService.get('authenticated');
|
|
|
- if (!authorized) {
|
|
|
+ if (!session.authenticated) {
|
|
|
if (response.status == 401) {// UNAUTHORIZED
|
|
|
// window.location.href = response.data.loginUrl || 'index';
|
|
|
// window.location.href = window.location.origin + window.location.pathname + '/login';
|