12345678910111213141516171819202122 |
- import { useFetch as _useFetch } from '#app'
- export async function useFetchRaw<T = any>(url: string, options?: any) {
- const config = useRuntimeConfig()
- const newOptions = {
- ...(options ?? {}),
- headers: {
- ...(options?.headers || {}),
- 'X-App-Type': config.public.appType
- },
- }
- const { data, error, pending, refresh, execute } = await _useFetch<T>(url, newOptions)
- return {
- data: {
- _rawValue: data.value,
- },
- error,
- pending,
- refresh,
- execute,
- }
- }
|