更新 attendance.html

master
wangsiyuan 2023-12-28 16:34:15 +08:00
parent d7a82f6780
commit fca154ee23
1 changed files with 3 additions and 24 deletions

View File

@ -67,31 +67,10 @@
<script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery --> <script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery -->
<script src="static/layui.js"></script> <script src="static/layui.js"></script>
<script src="/static/js/menu.js"></script>
<script src="/static/js/logout.js"></script>
<script> <script>
// 请求后端获取菜单数据 // 请求后端获取菜单数
$.get('/api/menu', function (menuItems) {
var menuList = $('.layui-nav.layui-nav-tree');
menuList.empty();
menuItems.forEach(function (item) {
var href = item.path || 'javascript:void(0);'; // 提供一个默认值
menuList.append('<li class="layui-nav-item"><a href="' + href + '">' + item.name + '</a></li>');
});
layui.element.render('nav', 'test');
});
layui.use(['jquery'], function () {
var $ = layui.jquery; // 获取Layui的jQuery对象
$('#logoutLink').on('click', function () {
// 向后端发送登出请求
$.get('/logout', function (data) {
// 重定向到登录页面,或根据后端响应做其他处理
window.location.href = '/login';
});
});
});
</script> </script>
</body> </body>
</html> </html>