src/store/modules/permission.js
/**
 * Use meta.role to determine if the current user has permission
 * @param roles
 * @param rights
 * @param route
 */
Use meta.role to determine if the current user has permission
@param roles
@param rights
@param route
Use meta . role to determine if the current user has permission @param roles @param rights @param route
function hasPermission(roles, rights, route) {
  if (route.meta) {
    return (route.meta.roles ? roles.some(role => route.meta.roles.includes(role.rolename )) : true) &&
      (route.meta.rights ? rights.some(right => route.meta.rights.includes(right.privname )) : true)
  } else {
    return true
  }
}
function hasPermission ( roles , rights , route ) { if ( route . meta ) { return ( route . meta . roles ? roles . some ( role => route . meta . roles . includes ( role . rolename ) ) : true ) && ( route . meta . rights ? rights . some ( right => route . meta . rights . includes ( right . privname ) ) : true ) } else { return true } }
Use meta.role to determine if the current user has permission
 @param roles
 @param rights
 @param route
Use meta . role to determine if the current user has permission @param roles @param rights @param route
// console.log('rights', rights, rights.some(right => route.meta.rights.includes(right.privname /* right.split(':')[0]*/))) /* role.split(':')[0]*/ /* right.split(':')[0]*/ // if (route.meta && route.meta.roles) { //   return roles.some(role => route.meta.roles.includes(role.split(":")[0])) // } else {