更新 attendance-reminder.html
parent
1bb907c71e
commit
d7a82f6780
|
|
@ -69,7 +69,7 @@
|
|||
src="//unpkg.com/outeres@0.0.10/img/layui/icon-v2.png"
|
||||
class="layui-nav-img"
|
||||
/>
|
||||
{{ session.nickname }}
|
||||
{{ session.name }}
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="/home/profile">资料</a></dd> <!-- 修改这里的href指向/profile -->
|
||||
|
|
@ -124,32 +124,9 @@
|
|||
|
||||
<script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery -->
|
||||
<script src="static/layui.js"></script>
|
||||
<script src="/static/js/menu.js"></script>
|
||||
<script src="/static/js/logout.js"></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';
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
layui.use(['layer'], function () {
|
||||
var layer = layui.layer;
|
||||
|
||||
|
|
|
|||
Reference in New Issue