2024-09-13 16:34:15 +08:00
|
|
|
import { ref, reactive, watch } from 'vue'
|
|
|
|
|
import { list as fetchUsers } from '@/api/user'
|
|
|
|
|
|
2024-10-31 22:27:30 +08:00
|
|
|
// todo 缓存所有用户信息
|
2024-09-13 16:34:15 +08:00
|
|
|
export function loadAllUsers () {
|
|
|
|
|
const allUsers = ref([])
|
|
|
|
|
const getAllUsers = async () => {
|
|
|
|
|
const res = await fetchUsers({ page_size: 9999 }).catch(_ => false)
|
|
|
|
|
if (res) {
|
|
|
|
|
allUsers.value = res.data.list
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
allUsers,
|
|
|
|
|
getAllUsers,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|