我有权限列表:
const all_permissions = [
{
permission_id: 1,
permission_name: "Getting User List",
permission_method: "GET",
permission_url: /^\/panel\/user$/
},
{
permission_id: 2,
permission_name: "Getting User Info",
permission_method: "GET",
permission_url: /^\/panel\/user\/[0-9]+$/
},
{
permission_id: 3,
permission_name: "Testing",
permission_method: "GET",
permission_url: /^\/panel\/test\/[a-z]+$/
}
]
const my_permissions = [1,2]
如何过滤 all_permissions 以仅匹配 my_permissions 中的 id?谢谢
互换的青春
墨色风雨
相关分类