function hasPermi (value) {
const all_permission = '*:*:*'
const permissions = store.getters && store.getters.permissions
const permissionFlag = value
const hasPermissions = permissions.some(permission => {
return all_permission === permission || permissionFlag.includes(permission)
})
return hasPermissions
}
/*传入权限吗*/
if (hasPermi(['homepage:sector:rdintensity'])) {
...
}
vue-admin或若依中判断是否有权限
最新推荐文章于 2024-08-14 14:43:54 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)