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