mixin role and config url

This commit is contained in:
saeid_01
2019-04-24 10:43:43 +04:30
parent d23c5f134b
commit df660dd7d4
24 changed files with 3430 additions and 3360 deletions
+16
View File
@@ -0,0 +1,16 @@
import { TokenService } from '@/services'
export default {
methods: {
$hasRole(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;
}
},
}