fix problems

This commit is contained in:
mahdi purHosseini
2023-09-11 14:02:23 +03:30
parent 1af9a45c79
commit d95a9942f0
2 changed files with 64 additions and 93 deletions
+2 -3
View File
@@ -3,16 +3,15 @@ import { TokenService } from '@/services'
const $hasRole = function(roles) {
if (TokenService.getToken()) {
roles = roles.split('|');
for (const role of roles) {
if(TokenService.getInfo().roles && Array.isArray(TokenService.getInfo().roles) && TokenService.getInfo().roles.includes(role)) {
return true;
}
}
}
return false;
};
export {
$hasRole
}
}