Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
permissionGetService: true,
permissionManageEmployee: true,
permissionManageRentingRoom: true,
permissionManagePatron: true,
permissionManagePatronKind: true,
permissionManagePosition: true,
permissionManagePrice: true,
permissionManageService: true,
permissionManageMap: true,
};
export type PermissionUnion = keyof PermissionType;
@Component
export class PermissionMixin extends Vue {
@(namespace('user').State)
private employee!: UserLogin.Employee;
@Prop({
default: true,
validator(value: boolean | string[]) {
if (typeof value === 'boolean') return true;
if (!Array.isArray(value)) return false;
return value.every((key: string) => {
const condition = `permission${key}` in permissionInstance;
if (!condition) {
console.error(
`[Permission warn]: String "${key}" is not a is not a valid prop for permission.\n`,
`Expect key to be one of these types:`,
<style lang="scss"></style>
})
export default class extends Vue {
id = '';
password = '';
layout() {
return 'side';
}
head() {
return {
title: 'Đăng nhập',
};
}
@(namespace('user').Action)
login;
}
import { UserState } from '~/store/user';
import { UserLogin } from '~/graphql/types';
@Component({
name: 'navbar-',
})
export default class extends Vue {
isInputFocus = false;
@(namespace('style').State)
breakpoint;
@(namespace('user').Action)
logout;
@(namespace('user').State(
(state: UserState) => state.employee || { position: {} },
))
employee!: UserLogin.Employee;
}
<style lang="scss"></style>
<style lang="scss"></style>
layout() {
return 'side';
}
head() {
return {
title: 'Khởi tạo tài khoản quản trị',
};
}
success() {
this.$router.push('/');
}
@(namespace('user').Action)
checkIsInitializedDatabase;
async beforeRouteEnter(to, from, next) {
next(vm => vm.checkIsInitializedDatabase());
}
}