2023-08-11 01:10:35 +00:00
|
|
|
import type { GlobalInfo } from "@/types";
|
2023-03-30 16:10:15 +00:00
|
|
|
import { useQuery } from "@tanstack/vue-query";
|
|
|
|
import axios from "axios";
|
|
|
|
|
|
|
|
export function useGlobalInfoFetch() {
|
|
|
|
const { data } = useQuery<GlobalInfo>({
|
|
|
|
queryKey: ["globalinfo"],
|
|
|
|
queryFn: async () => {
|
2024-05-30 08:31:16 +00:00
|
|
|
const { data } = await axios.get<GlobalInfo>(`/actuator/globalinfo`, {
|
|
|
|
withCredentials: true,
|
|
|
|
});
|
2023-03-30 16:10:15 +00:00
|
|
|
|
|
|
|
return data;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
globalInfo: data,
|
|
|
|
};
|
|
|
|
}
|