Kaynağa Gözat

修改了logout,原来删除Cookie的代码有问题

huqi 5 yıl önce
ebeveyn
işleme
9ce9d27bfc

+ 1 - 4
o2web/source/o2_core/o2/xDesktop/Authentication.js

@@ -84,10 +84,7 @@ MWF.xDesktop.Authentication = new Class({
                 this.socket.close();
                 this.socket = null;
             }
-            Cookie.dispose("x-token", {
-                "domain": ".ctc.com",
-                "path": "/"
-            });
+            Cookie.dispose("x-token");
             window.location.reload();
         }.bind(this));
     },

+ 11 - 0
o2web/source/o2_core/o2/xDesktop/Layout.js

@@ -1099,6 +1099,17 @@ MWF.xDesktop.Layout = new Class({
             this.messageAudio.play();
             this.playMessageAudioTime = new Date();
         }
+    },
+    logout: function(){
+        this.isLogout = true;
+
+        if (!this.notRecordStatus){
+            this.recordDesktopStatus(function(){
+                (layout.authentication ||  new o2.xDesktop.Authentication()).logout();
+            }.bind(this.layout));
+        }else{
+            (layout.authentication ||  new o2.xDesktop.Authentication()).logout();
+        }
     }
 });
 MWF.xDesktop.Layout.Taskitem = new Class({