mirror of https://github.com/halo-dev/halo
21 lines
449 B
TypeScript
21 lines
449 B
TypeScript
import type { GlobalInfo } from "@/types";
|
|
import { useQuery } from "@tanstack/vue-query";
|
|
import axios from "axios";
|
|
|
|
export function useGlobalInfoFetch() {
|
|
const { data } = useQuery<GlobalInfo>({
|
|
queryKey: ["globalinfo"],
|
|
queryFn: async () => {
|
|
const { data } = await axios.get<GlobalInfo>(`/actuator/globalinfo`, {
|
|
withCredentials: true,
|
|
});
|
|
|
|
return data;
|
|
},
|
|
});
|
|
|
|
return {
|
|
globalInfo: data,
|
|
};
|
|
}
|