mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-27 07:20:18 +08:00
refactor(projects): remove enum
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
<script setup lang="ts">
|
||||
import { watch } from 'vue';
|
||||
import type { SelectOption } from 'naive-ui';
|
||||
import { EnumUserRole } from '@/enum';
|
||||
import { userRoleOptions } from '@/constants';
|
||||
import { useAppStore, useAuthStore } from '@/store';
|
||||
import { usePermission } from '@/composables';
|
||||
|
||||
@@ -42,18 +42,7 @@ const app = useAppStore();
|
||||
const auth = useAuthStore();
|
||||
const { hasPermission } = usePermission();
|
||||
|
||||
interface RoleList {
|
||||
label: string;
|
||||
value: keyof typeof EnumUserRole;
|
||||
}
|
||||
|
||||
const roleList: RoleList[] = [
|
||||
{ label: EnumUserRole.super, value: 'super' },
|
||||
{ label: EnumUserRole.admin, value: 'admin' },
|
||||
{ label: EnumUserRole.user, value: 'user' }
|
||||
];
|
||||
|
||||
const options: SelectOption[] = roleList as unknown as SelectOption[];
|
||||
const options: SelectOption[] = userRoleOptions;
|
||||
|
||||
watch(
|
||||
() => auth.userInfo.userRole,
|
||||
|
||||
Reference in New Issue
Block a user