Browse Source

单点登录

yuansh 2 years ago
parent
commit
363e741f7b
2 changed files with 12 additions and 7 deletions
  1. 4 1
      src/cas/sso.js
  2. 8 6
      src/store/modules/user.js

+ 4 - 1
src/cas/sso.js

@@ -9,6 +9,8 @@ const init = (callback) => {
   let token = Vue.ls.get(ACCESS_TOKEN);
   let st = getUrlParam("ticket");
   var sevice = "http://"+window.location.host+"/";
+  // console.log("-------单点登1录开始-------",st);
+  // console.log("-------单点登2录开始-------",sevice);
   if(token){
     loginSuccess(callback);
   }else{
@@ -28,7 +30,8 @@ const SSO = {
 function getUrlParam(paraName) {
   var url = document.location.toString();
   var arrObj = url.split("?");
-
+// console.log("-------单点登3录开始-------",url);
+// console.log("-------单点登4录开始-------",arrObj);
   if (arrObj.length > 1) {
     var arrPara = arrObj[1].split("&");
     var arr;

+ 8 - 6
src/store/modules/user.js

@@ -200,9 +200,9 @@ const user = {
         commit('SET_TOKEN', '')
         commit('SET_PERMISSIONLIST', [])
         
-        commit('SET_INFO', '')
-        commit('SET_NAME', {})
-        commit('SET_AVATAR', '')
+        // commit('SET_INFO', '')
+        // commit('SET_NAME', {})
+        // commit('SET_AVATAR', '')
         
         Vue.ls.remove(ACCESS_TOKEN)
         Vue.ls.remove(USER_INFO)
@@ -215,11 +215,13 @@ const user = {
             let serviceUrl = encodeURIComponent(sevice)
             // window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl
             window.location.href = window._CONFIG['casPrefixUrl']+"/logout?service="+serviceUrl;
-            resolve()
+            // resolve()
             // setTimeout(function(){
-            //   resolve()
-            // },0)
+            //   window.location.href = 'http://www.myfitt.cn:18086/';
+            //   // resolve()
+            // },110)
         }).catch(() => {
+          console.log("1111111111111111111111111111111111111111111111111111")
           resolve()
         })
       })