Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] 页面跳转菜单高亮显示错误

Open
#13 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
database, frontend

Research direction

Start with the menu configuration and the code that writes configured menus to the database, then trace how the user-menu-id is matched with the API response. The fix is done when menu ordering can change without breaking navigation highlighting and the attachment management entry remains accessible.

Written by the indexing model from the issue text.

Description

问题描述及重现步骤:

从页面右上角点击 基本资料 会跳转到 通用设置 -> 附件管理 ,使原本的 附件管理 功能无法打开,应该高亮显示 个人资料

相关截图:

image

<!-- 功 能 菜 单 -->
<dl class="layui-nav-child">
    <dd><a user-menu-url="/app/admin/account/index" user-menu-id="11" user-menu-title="基本资料">基本资料</a></dd>
    <dd><a href="javascript:void(0);" class="logout">注销登录</a></dd>
</dl>

查看代码发现 user-menu-id 设置的是 11,而接口返回的正确的 id 是10。改成 10 果然就正确了,但是这个时候我多想了一下,这个菜单是怎么写入到数据库里的?

查看了插件中的 SQL 文件其中并没有批量插入菜单,而是通过读取配置文件里设置的菜单从上到下依次写入到数据库里面的,也就是说随着功能开发菜单顺序有可能改变,菜单的 id 也不是固定的。

不设置 user-menu-id 好像又无法正常跳转页面,需要解决一下菜单 id 不固定的问题。

Dominant language
JavaScript
Stars
378
Forks
48
Avg merge
20h 9m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from webman-php/admin

All issues in webman-php/admin

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.