top.jsp 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <div class="mininav">
  4. <table height="100%" width="1170" align="center">
  5. <tr>
  6. <td valign="center" align="left" width="50%">
  7. <a id="a_home" href="/mp/home" style="margin-right: 20px;">首页</a>
  8. <a id="a_push" href="/mp/push" style="margin-right: 20px;">群发消息</a>
  9. <a id="a_menu" href="/mp/menu" style="margin-right: 20px;">自定义菜单</a>
  10. <a id="a_msgs" href="/mp/msgs" style="margin-right: 20px;">消息管理</a>
  11. <a id="a_fans" href="/mp/fans">粉丝管理</a>
  12. </td>
  13. <td valign="center" align="right" width="50%">
  14. <c:if test="${empty sessionScope.MP_USER}">您尚未登录,<a href="/mp/login">请登录</a></c:if>
  15. <c:if test="${not empty sessionScope.MP_USER}">
  16. 欢迎你,<b>${sessionScope.MP_USER.nickname}</b>!<a href="/mp/logout" style="margin-left: 10px;">退出登录</a>
  17. </c:if>
  18. </td>
  19. </tr>
  20. </table>
  21. <script type="text/javascript">
  22. $(function() {
  23. var url = window.location.href;
  24. var id = url.substr(url.lastIndexOf('/') + 1);
  25. if (id.indexOf('.jsp') != -1)
  26. id = id.replace(/.jsp/g, "");
  27. console.log(id)
  28. $("#a_" + id).css({
  29. "color" : "#000",
  30. "font-weight" : "bold"
  31. });
  32. });
  33. </script>
  34. </div>