zhengyiming
10 天以前 d4e154a30bd6203be108332f86572ab5687c79e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { useUserStore } from '@/store/modules/user';
import { UserUtils } from '@bole-core/core';
// import * as userRoleServices from '@/services/api/UserRole';
import * as userServices from '@/services/api/User';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
 
export function useIsSystemAdmin() {
  const userStore = useUserStore();
  const { accountInfo } = storeToRefs(userStore);
  const isSystemAdmin = computed(() => UserUtils.isSystemRole(accountInfo.value));
  return isSystemAdmin;
}
 
export function useUser() {
  const userStore = useUserStore();
 
  const { userId, userInfo } = storeToRefs(userStore);
 
  return {
    user: userInfo,
    userId: userId,
  };
}