lsc 2 周之前
父节点
当前提交
d772abc8a3
共有 1 个文件被更改,包括 4 次插入14 次删除
  1. 4 14
      js/Desktop/Onload.js

+ 4 - 14
js/Desktop/Onload.js

@@ -44,12 +44,12 @@ window.onload = function () {
     //     // window.location.reload();
     // })
 
-    window.addEventListener('beforeunload', function (event) { 
+    window.onbeforeunload = function (event) { 
         // 阻止默认行为 
         event.preventDefault(); 
         event.returnValue = ''; 
         // / 对某些浏览器有效 
-    });
+    }
 }
 
 US.Config = {
@@ -679,12 +679,7 @@ U.MD.D.getuser = function () {
     }
     var _cookie = U.UF.Cookie.get("cocorobo");
     if(LoginState && !_cookie){
-        window.removeEventListener('beforeunload', function (event) { 
-            // 阻止默认行为 
-            event.preventDefault(); 
-            event.returnValue = ''; 
-            // / 对某些浏览器有效 
-        });
+        window.onbeforeunload = null
         window.location.reload();
     }else if(LoginState && !CookieS){
         CookieS = _cookie
@@ -707,12 +702,7 @@ U.MD.D.getuser = function () {
 
                 }, [], { "type": "GET", "withCredentials": true });
             }else {
-                window.removeEventListener('beforeunload', function (event) { 
-                    // 阻止默认行为 
-                    event.preventDefault(); 
-                    event.returnValue = ''; 
-                    // / 对某些浏览器有效 
-                });
+                window.onbeforeunload = null
                 window.location.reload();
             }
         }, [], { "type": "GET", "withCredentials": true });