Update files.
This commit is contained in:
parent
f00f10ca3d
commit
1ccf9e09ba
|
@ -1,5 +1,5 @@
|
||||||
VITE_API_NAME=api/
|
NUXT_PUBLIC_API_NAME=api/
|
||||||
VITE_BASE_URL=http://192.168.23.60/
|
NUXT_PUBLIC_BASE_URL=http://192.168.23.60/
|
||||||
|
|
||||||
VITE_APP_NAME=Hadith
|
VITE_APP_NAME=Hadith
|
||||||
|
|
||||||
|
|
18
app.vue
18
app.vue
|
@ -2,27 +2,9 @@
|
||||||
<UApp :locale="fa_ir">
|
<UApp :locale="fa_ir">
|
||||||
<NuxtLoadingIndicator />
|
<NuxtLoadingIndicator />
|
||||||
<NuxtRouteAnnouncer />
|
<NuxtRouteAnnouncer />
|
||||||
<!-- <DevOnly> -->
|
|
||||||
<!-- this component will only be rendered during development -->
|
|
||||||
<!-- <LazyDebugBar /> -->
|
|
||||||
|
|
||||||
<!-- if you ever require to have a replacement during production -->
|
|
||||||
<!-- be sure to test these using `nuxt preview` -->
|
|
||||||
<!-- <template #fallback> -->
|
|
||||||
<!-- <div>empty div for flex.justify-between</div> -->
|
|
||||||
<!-- </template> -->
|
|
||||||
<!-- </DevOnly> -->
|
|
||||||
|
|
||||||
<NuxtLayout>
|
<NuxtLayout>
|
||||||
<!-- this component will be rendered on client-side -->
|
|
||||||
<!-- <NuxtClientFallback
|
|
||||||
fallback-tag="span"
|
|
||||||
fallback="NuxtClientFallback"
|
|
||||||
@ssr-error="logSomeError"
|
|
||||||
> -->
|
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
<!-- <BrokeInSsr /> -->
|
|
||||||
<!-- </NuxtClientFallback> -->
|
|
||||||
</NuxtLayout>
|
</NuxtLayout>
|
||||||
</UApp>
|
</UApp>
|
||||||
</template>
|
</template>
|
||||||
|
|
31
composables/useHadithaSearchComposable.ts
Normal file
31
composables/useHadithaSearchComposable.ts
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
// composables/useHadithaSearchComposable.js
|
||||||
|
import { useStorage } from "@vueuse/core";
|
||||||
|
|
||||||
|
export const useHadithaSearchComposable = <T>(url, options = {}) => {
|
||||||
|
const loading = ref(false); // Track loading state
|
||||||
|
const data = ref<T | null>(null);
|
||||||
|
const error = ref<any>(null);
|
||||||
|
const status = ref<string | null>(null);
|
||||||
|
|
||||||
|
// Get the authentication token (e.g., from a cookie or local storage)
|
||||||
|
// const token = useCookie('auth-token') // Assuming you store the token in a cookie
|
||||||
|
let token = useStorage("id_token", "GuestAccess");
|
||||||
|
const config = useRuntimeConfig();
|
||||||
|
console.info(config);
|
||||||
|
|
||||||
|
const baseURL =
|
||||||
|
config.public.NUXT_PUBLIC_BASE_URL + config.public.NUXT_PUBLIC_API_NAME;
|
||||||
|
|
||||||
|
// Add headers to the request
|
||||||
|
const headers = {
|
||||||
|
Authorization: token.value,
|
||||||
|
...options.headers, // Merge with any existing headers
|
||||||
|
};
|
||||||
|
|
||||||
|
// Use useFetch with the headers
|
||||||
|
return useFetch<T>(url, {
|
||||||
|
...options,
|
||||||
|
baseURL: baseURL,
|
||||||
|
headers,
|
||||||
|
});
|
||||||
|
};
|
|
@ -9,6 +9,12 @@ export default [
|
||||||
path: "/haditha/search",
|
path: "/haditha/search",
|
||||||
file: "~/systems/hadith_ui/pages/haditha/search/index.vue",
|
file: "~/systems/hadith_ui/pages/haditha/search/index.vue",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "hadithaSearchShow",
|
||||||
|
path: "/haditha/search/:id/:slug?",
|
||||||
|
file: "~/systems/hadith_ui/pages/haditha/searchy/[id]/[slug]/index.vue",
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "hadithaChatBot",
|
name: "hadithaChatBot",
|
||||||
path: "/haditha/chat-bot",
|
path: "/haditha/chat-bot",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user