feat: Implement initial Vue 3 application structure with SSR, routing, authentication, and core dashboard components.

This commit is contained in:
2026-01-19 00:37:35 +07:00
parent 9f521c76f4
commit eed14fa0e5
14 changed files with 1029 additions and 127 deletions

View File

@@ -2,18 +2,19 @@ import { tryGetContext } from "hono/context-storage";
export const customFetch = async (url: string, options: RequestInit) => {
options.credentials = "include";
if (!options.headers) {
options.headers = {};
}
if (import.meta.env.SSR) {
const c = tryGetContext<any>();
if (!c) {
throw new Error("Hono context not found in SSR");
}
// Object.entries(c.req.header()).forEach(([k, v]) => {
// Object.assign(options.headers!, { [k]: v });
// });
return await c.get("fetch")(url, options);
Object.assign(options, {
headers: c.req.header()
});
const res = await fetch(url, options);
res.headers.forEach((value, key) => {
c.header(key, value);
});
return res;
}
return fetch(url, options);
}