소스 검색

优化用户登出体验

UnknownO 3 년 전
부모
커밋
2f272aca76
3개의 변경된 파일11개의 추가작업 그리고 22개의 파일을 삭제
  1. 0 11
      pages/admin/general.php
  2. 0 11
      pages/admin/homepage.php
  3. 11 0
      static/js/main.js

+ 0 - 11
pages/admin/general.php

@@ -64,17 +64,6 @@ if ($templateMode) {
         </button>
     </div>
     <script>
-        function logout() {
-            setCookie('loveway_token', "kagamine yes!", -1);
-            mdui.snackbar({
-                message: "登出成功!页面即将刷新!",
-                position: 'right-top'
-            });
-            setTimeout(function() {
-                location.reload()
-            }, 1500);
-        }
-
         function setCookie(cname, cvalue, exdays) {
             var d = new Date();
             d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));

+ 0 - 11
pages/admin/homepage.php

@@ -57,17 +57,6 @@ if ($ADMIN_PASS == "kagamine1234") {
 }
 ?>
 <script>
-    function logout() {
-        setCookie('loveway_token', "kagamine yes!", -1);
-        mdui.snackbar({
-            message: "登出成功!",
-            position: 'right-top'
-        });
-        $.pjax.reload({
-            container: "#pjax-container"
-        })
-    }
-
     function setCookie(cname, cvalue, exdays) {
         var d = new Date();
         d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));

+ 11 - 0
static/js/main.js

@@ -109,4 +109,15 @@ function jumpPage() {
             }, 10)
         }
     )
+}
+
+function logout() {
+    setCookie('loveway_token', "kagamine yes!", -1);
+    mdui.snackbar({
+        message: "登出成功!",
+        position: 'right-top'
+    });
+    $.pjax.reload({
+        container: "#pjax-container"
+    })
 }