From 756e2ca96e14baeaa934bcd977b6bf6a01216c70 Mon Sep 17 00:00:00 2001 From: wangsiyuan <2392948297@qq.com> Date: Thu, 28 Dec 2023 16:34:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=20logout.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/logout.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/static/js/logout.js diff --git a/app/static/js/logout.js b/app/static/js/logout.js new file mode 100644 index 0000000..29edab8 --- /dev/null +++ b/app/static/js/logout.js @@ -0,0 +1,9 @@ +var $ = layui.jquery; // 获取Layui的jQuery对象 + +$('#logoutLink').on('click', function () { + // 向后端发送登出请求 + $.get('/logout', function (data) { + // 重定向到登录页面,或根据后端响应做其他处理 + window.location.href = '/login'; + }); +}); \ No newline at end of file