refactor(composables): update useApiFetch composable

add authorization header
This commit is contained in:
parent a5a3147365
commit ec13656660
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -1,13 +1,13 @@
import { AsyncData } from "#app";
const useApiFetch = async <T>(url: string, options?: any) => {
// const { token } = useAuth();
const { token } = useAuth();
let head = {
...(options?.headers || {}),
};
// if (token.value) {
// head.Authorization = token.value;
// }
if (token.value) {
head.Authorization = token.value;
}
/* const cached = useSessionStorage<T>(url, null, {
serializer: StorageSerializers.object,
});