Skip to content

menurole在sort为0时,返回的菜单相对于数据库顺序而言,是无序的 #838

@chanmaoganda

Description

@chanmaoganda

Describe the bug
在创建多个菜单,并且菜单的sort全部为0的时候,请求menurole会出现结果乱序的情况

To Reproduce
在创建多个菜单,并且菜单的sort全部为0的时候,请求menurole会出现结果乱序的情况

[
{
                    "menuId": 3,
                    "menuName": "SysUserManage",
                    "title": "用户管理",
                    "icon": "user",
                    "path": "/admin/sys-user",
                    "paths": "",
                    "menuType": "C",
                    "action": "",
                    "permission": "admin:sysUser:list",
                    "parentId": 2,
                    "noCache": false,
                    "breadcrumb": "",
                    "component": "/admin/sys-user/index",
                    "sort": 0,
                    "visible": "0",
                    "isFrame": "",
                    "sysApi": null,
                    "apis": null,
                    "dataScope": "",
                    "params": "",
                    "RoleId": 0,
                    "is_select": false,
                    "createBy": 0,
                    "updateBy": 0,
                    "createdAt": "2021-05-20T22:08:44.526+08:00",
                    "updatedAt": "0001-01-01T00:00:00Z"
                },
                {
                    "menuId": 528,
                    "menuName": "SysApiManage",
                    "title": "接口管理",
                    "icon": "api-doc",
                    "path": "/admin/sys-api",
                    "paths": "",
                    "menuType": "C",
                    "action": "",
                    "permission": "admin:sysApi:list",
                    "parentId": 2,
                    "noCache": false,
                    "breadcrumb": "",
                    "component": "/admin/sys-api/index",
                    "sort": 0,
                    "visible": "0",
                    "isFrame": "",
                    "sysApi": null,
                    "apis": null,
                    "dataScope": "",
                    "params": "",
                    "RoleId": 0,
                    "is_select": false,
                    "createBy": 0,
                    "updateBy": 0,
                    "createdAt": "2021-05-20T22:08:44.526+08:00",
                    "updatedAt": "0001-01-01T00:00:00Z"
                },
                {
                    "menuId": 540,
                    "menuName": "SysConfigSet",
                    "title": "参数设置",
                    "icon": "system-tools",
                    "path": "/admin/sys-config/set",
                    "paths": "",
                    "menuType": "C",
                    "action": "",
                    "permission": "admin:sysConfigSet:list",
                    "parentId": 2,
                    "noCache": false,
                    "breadcrumb": "",
                    "component": "/admin/sys-config/set",
                    "sort": 0,
                    "visible": "0",
                    "isFrame": "",
                    "sysApi": null,
                    "apis": null,
                    "dataScope": "",
                    "params": "",
                    "RoleId": 0,
                    "is_select": false,
                    "createBy": 0,
                    "updateBy": 0,
                    "createdAt": "2021-05-25T16:06:52.56+08:00",
                    "updatedAt": "0001-01-01T00:00:00Z"
                },
                {
                    "menuId": 51,
                    "menuName": "SysMenuManage",
                    "title": "菜单管理",
                    "icon": "tree-table",
                    "path": "/admin/sys-menu",
                    "paths": "",
                    "menuType": "C",
                    "action": "",
                    "permission": "admin:sysMenu:list",
                    "parentId": 2,
                    "noCache": true,
                    "breadcrumb": "",
                    "component": "/admin/sys-menu/index",
                    "sort": 0,
                    "visible": "0",
                    "isFrame": "",
                    "sysApi": null,
                    "apis": null,
                    "dataScope": "",
                    "params": "",
                    "RoleId": 0,
                    "is_select": false,
                    "createBy": 0,
                    "updateBy": 0,
                    "createdAt": "2021-05-20T22:08:44.526+08:00",
                    "updatedAt": "0001-01-01T00:00:00Z"
                },
                {
                    "menuId": 52,
                    "menuName": "SysRoleManage",
                    "title": "角色管理",
                    "icon": "peoples",
                    "path": "/admin/sys-role",
                    "paths": "",
                    "menuType": "C",
                    "action": "",
                    "permission": "admin:sysRole:list",
                    "parentId": 2,
                    "noCache": true,
                    "breadcrumb": "",
                    "component": "/admin/sys-role/index",
                    "sort": 0,
                    "visible": "0",
                    "isFrame": "",
                    "sysApi": null,
                    "apis": null,
                    "dataScope": "",
                    "params": "",
                    "RoleId": 0,
                    "is_select": false,
                    "createBy": 0,
                    "updateBy": 0,
                    "createdAt": "2021-05-20T22:08:44.526+08:00",
                    "updatedAt": "0001-01-01T00:00:00Z"
                },
]

Expected behavior
最起码返回的菜单应该要有序

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions