Browse Source

合并冲突代码

jinsy 7 years ago
parent
commit
f56c8957b1

+ 10 - 5
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -137,14 +137,19 @@ import { setTimeout } from 'timers';
             },
             //退出
             loginout(){
-                this.$router.push({path:'/home'});
-                this.loginout2()
-            },
-            loginout2(){
+                //this.$router.push({path:'/name'});
                 const frame = window.frames[window.frames.length - 1]
                 frame.postMessage('', '*')
                 Session.remove()
-            } 
+                window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL=https://'+window.location.host
+                // this.loginout2()
+            }
+            // ,
+            // loginout2(){
+            //     const frame = window.frames[window.frames.length - 1]
+            //     frame.postMessage('', '*')
+            //     Session.remove()
+            // } 
         },
     }
 </script>

+ 21 - 22
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -41,7 +41,7 @@
           </ul>
         </div>
         </div>
-        
+
     </div>
 
     <iframe hidden :src="setTokenPage"></iframe>
@@ -339,10 +339,8 @@
       }
     },
     created(){
-      var uid = this.getCookie('uid');
-      if(uid){
         this.$ajax({
-          url: '/api/auth/info',
+          url: this.$url.api+'/api/auth/info',
           method: 'get',
           async:false,
           withCredentials:true
@@ -352,11 +350,11 @@
           account.companies = account.companies || []
           session.account = account
           Session.set(session);
+          this.account = Session.getAccount();
         })
         .catch(err=>{
           console.log("请求失败",err)
         })
-      }
     },
     mounted() {
       this.clientId = Math.random().toString(36).substr(2)
@@ -379,20 +377,20 @@
       }
     },
     methods: {
-        getCookie(cookieName){  
-          var cookieValue="";  
-          if (document.cookie && document.cookie != '') {   
-              var cookies = document.cookie.split(';');  
-              for (var i = 0; i < cookies.length; i++) {   
-                  var cookie = cookies[i];  
-                  if (cookie.substring(0, cookieName.length + 2).trim() == cookieName.trim() + "=") {  
-                        cookieValue = cookie.substring(cookieName.length + 2, cookie.length);   
-                        break;  
-                  }  
-              }  
-          }   
-          return cookieValue;  
-      }, 
+      //   hasCookie(cookieName){
+      //     var hasUid=false;
+      //     if (document.cookie && document.cookie != '') {
+      //         var cookies = document.cookie.split(';');
+      //         for (var i = 0; i < cookies.length; i++) {
+      //             var cookie = cookies[i];
+      //             if (cookie.substring(0, cookieName.length+1).trim() == cookieName.trim() + "=") {
+      //                   hasUid=true;
+      //                   break;
+      //             }
+      //         }
+      //     }
+      //     return hasUid;
+      // },
       tab(i){
         this.Nowindex = i;
       },
@@ -418,7 +416,7 @@
               // 跳转应用页面
               window.location.href = me.$url.web
             }
-           } 
+           }
           }, false)
           frame.postMessage(JSON.stringify(session), '*')
         })
@@ -438,7 +436,8 @@
         const frame = window.frames[window.frames.length - 1]
         frame.postMessage('', '*')
         Session.remove()
-        this.$router.go(0); 
+        window.location.href=this.$url.sso+'/logquit?appId=sp&returnURL=https://'+window.location.host
+        //this.$router.go(0);
       },
       // 关闭窗口
       closeModal() {
@@ -495,7 +494,7 @@
                 // console.log("请求失败",err)
             })
           }
-        } 
+        }
       },
     }
   }

+ 5 - 1
frontend/saas-web/app/view/viewport/ViewportController.js

@@ -76,7 +76,11 @@ Ext.define('saas.view.viewport.ViewportController', {
             //没有session时  判断cookie中的uid
             var hasValidCookie = Ext.util.Cookies.get('uid')?me.getAccountCookie():false;
             if(!hasValidCookie){
-                me.redirectTo('login', {replace: true});
+                if(window.location.host.indexOf('.usoftchina.com')>-1){
+                    window.location.href = Ext.manifest.server.accountCenter
+                }else{
+                    me.redirectTo('login', {replace: true});
+                }
             }else{
                 me.redirectTo('main', {replace: true});
             }