seimin před 3 roky
rodič
revize
db5e852bd1

+ 5 - 0
assets/js/controllers/loginCtrl.js

@@ -132,6 +132,11 @@ app.controller('LoginCtrl', ['$rootScope', '$scope', '$state', '$translate', '$l
132 132
             api_login.login(postData)
133 133
                 .then(function (resp) {
134 134
                     console.log(resp);
135
+                    if ($scope.isSSo) {
136
+                        localStorage.setItem('isSSo', '1');//单点登录
137
+                    } else {
138
+                        localStorage.setItem('isSSo', '0');//正常登录
139
+                    }
135 140
                     if (resp.state == "10000") {//license失效
136 141
                         // console.log($scope.loginForm);
137 142
                         if (resp.role) {

+ 15 - 12
assets/js/controllers/mainCtrl.js

@@ -1823,18 +1823,21 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1823 1823
         $rootScope.logout = function () {
1824 1824
             // var  userid =data.id;
1825 1825
             // console.log(' userid='+JSON.stringify( userid));
1826
-
1827
-            // $auth.signOut()
1828
-            //     .then(function(resp) {
1829
-            //         // $auth.deleteData('auth_headers')
1830
-            //         sessionStorage.clear();
1831
-            //         localStorage.clear();
1832
-            //         $state.go("login.signin");
1833
-            //     })
1834
-            //     .catch(function(resp) {});
1835
-            sessionStorage.clear();
1836
-            localStorage.clear();
1837
-            location.href = 'http://' + location.hostname + ':8080/pc_logout.jsp'
1826
+            //单点登录
1827
+            if (localStorage.getItem('isSSo') === '1') {
1828
+                sessionStorage.clear();
1829
+                localStorage.clear();
1830
+                location.href = 'http://' + location.hostname + ':8080/pc_logout.jsp'
1831
+            } else {
1832
+                $auth.signOut()
1833
+                    .then(function (resp) {
1834
+                        // $auth.deleteData('auth_headers')
1835
+                        sessionStorage.clear();
1836
+                        localStorage.clear();
1837
+                        $state.go("login.signin");
1838
+                    })
1839
+                    .catch(function (resp) { });
1840
+            }
1838 1841
 
1839 1842
 
1840 1843
             //$cookieStore.remove("userObm");