| | |
| | | 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() { |
| | |
| | | } |
| | | |
| | | export function useAllRoleList() { |
| | | const { data: allRoleList, refetch } = useQuery({ |
| | | queryKey: ['userServices/getAllRoles'], |
| | | queryFn: async () => { |
| | | let res = await userServices.getAllRoles({ showLoading: false }); |
| | | return res; |
| | | }, |
| | | placeholderData: () => [] as API.RoleInfo[], |
| | | }); |
| | | // const { data: allRoleList, refetch } = useQuery({ |
| | | // queryKey: ['userServices/getAllRoles'], |
| | | // queryFn: async () => { |
| | | // let res = await userServices.getAllRoles({ showLoading: false }); |
| | | // return res; |
| | | // }, |
| | | // placeholderData: () => [] as API.RoleInfo[], |
| | | // }); |
| | | |
| | | // return { |
| | | // allRoleList, |
| | | // refetch, |
| | | // }; |
| | | return { |
| | | allRoleList, |
| | | refetch, |
| | | allRoleList: [], |
| | | refetch: () => {}, |
| | | }; |
| | | } |