浏览代码

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

huqi 6 年之前
父节点
当前提交
9ce9d27bfc
共有 2 个文件被更改,包括 12 次插入4 次删除
  1. 1 4
      o2web/source/o2_core/o2/xDesktop/Authentication.js
  2. 11 0
      o2web/source/o2_core/o2/xDesktop/Layout.js

+ 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({