mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 19:01:06 +03:30
fix problems
This commit is contained in:
+2
-3
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user