feat: 初始化居家上门服务系统完整项目代码
- Spring Boot 后端服务 (hss-home-service) - delivery-miniapp 配送小程序 - website 官网 (Nuxt) - docs 架构设计文档 - Docker 容器化部署配置 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { escapeHtml } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/@vue/shared/dist/shared.cjs.prod.js';
|
||||
|
||||
const _messages = {
|
||||
"appName": "Nuxt",
|
||||
"version": "",
|
||||
"status": 500,
|
||||
"statusText": "Server error",
|
||||
"description": "This page is temporarily unavailable."
|
||||
};
|
||||
const template = (messages) => {
|
||||
messages = {
|
||||
..._messages,
|
||||
...messages
|
||||
};
|
||||
return "<!DOCTYPE html><html lang=\"en\"><head><title>" + escapeHtml(messages.status) + " - " + escapeHtml(messages.statusText) + " | " + escapeHtml(messages.appName) + "</title><meta charset=\"utf-8\"><meta content=\"width=device-width,initial-scale=1.0,minimum-scale=1.0\" name=\"viewport\"><style>.spotlight{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);filter:blur(20vh)}*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:\"\"}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.fixed{position:fixed}.-bottom-1\\/2{bottom:-50%}.left-0{left:0}.right-0{right:0}.grid{display:grid}.mb-16{margin-bottom:4rem}.mb-8{margin-bottom:2rem}.h-1\\/2{height:50%}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.place-content-center{place-content:center}.overflow-hidden{overflow:hidden}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-8{padding-left:2rem;padding-right:2rem}.text-center{text-align:center}.text-8xl{font-size:6rem;line-height:1}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-black{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light{font-weight:300}.font-medium{font-weight:500}.leading-tight{line-height:1.25}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\\:bg-black{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\\:px-0{padding-left:0;padding-right:0}.sm\\:text-4xl{font-size:2.25rem;line-height:2.5rem}}</style><script>!function(){const e=document.createElement(\"link\").relList;if(!(e&&e.supports&&e.supports(\"modulepreload\"))){for(const e of document.querySelectorAll('link[rel=\"modulepreload\"]'))r(e);new MutationObserver(e=>{for(const o of e)if(\"childList\"===o.type)for(const e of o.addedNodes)\"LINK\"===e.tagName&&\"modulepreload\"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),\"use-credentials\"===e.crossOrigin?r.credentials=\"include\":\"anonymous\"===e.crossOrigin?r.credentials=\"omit\":r.credentials=\"same-origin\",r}(e);fetch(e.href,r)}}();<\/script></head><body class=\"antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black\"><div class=\"-bottom-1/2 fixed h-1/2 left-0 right-0 spotlight\"></div><div class=\"max-w-520px text-center\"><h1 class=\"font-medium mb-8 sm:text-10xl text-8xl\">" + escapeHtml(messages.status) + "</h1><p class=\"font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl\">" + escapeHtml(messages.description) + "</p></div></body></html>";
|
||||
};
|
||||
|
||||
export { template };
|
||||
//# sourceMappingURL=error-500.mjs.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error-500.mjs","sources":["../../../../node_modules/@nuxt/nitro-server/dist/runtime/templates/error-500.mjs"],"names":[],"mappings":"","x_google_ignoreList":[0]}
|
||||
568
hss-home-service/website/.nuxt/prerender/chunks/_/renderer.mjs
Normal file
568
hss-home-service/website/.nuxt/prerender/chunks/_/renderer.mjs
Normal file
@@ -0,0 +1,568 @@
|
||||
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/vue-bundle-renderer/dist/runtime.mjs';
|
||||
import { getResponseStatusText, getResponseStatus, getQuery, createError, appendResponseHeader } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/h3/dist/index.mjs';
|
||||
import { joinRelativeURL, encodePath, joinURL } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/ufo/dist/index.mjs';
|
||||
import { renderToString } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/vue/server-renderer/index.mjs';
|
||||
import { a as useRuntimeConfig, b as useStorage, d as defineRenderHandler, g as getRouteRules, u as useNitroApp } from '../nitro/nitro.mjs';
|
||||
import { createHead as createHead$1, propsToString, renderSSRHead } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unhead/dist/server.mjs';
|
||||
import { AsyncLocalStorage } from 'node:async_hooks';
|
||||
import { stringify, uneval } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/devalue/index.js';
|
||||
import { FlatMetaPlugin, DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unhead/dist/plugins.mjs';
|
||||
import { walkResolver } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/unhead/dist/utils.mjs';
|
||||
import { isRef, toValue, hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'file:///home/akoo/%E5%B1%85%E5%AE%B6%E6%9C%8D%E5%8A%A1/hss-home-service/website/node_modules/vue/index.mjs';
|
||||
|
||||
const VueResolver = (_, value) => {
|
||||
return isRef(value) ? toValue(value) : value;
|
||||
};
|
||||
|
||||
const headSymbol = "usehead";
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function vueInstall(head) {
|
||||
const plugin = {
|
||||
install(app) {
|
||||
app.config.globalProperties.$unhead = head;
|
||||
app.config.globalProperties.$head = head;
|
||||
app.provide(headSymbol, head);
|
||||
}
|
||||
};
|
||||
return plugin.install;
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function injectHead() {
|
||||
if (hasInjectionContext()) {
|
||||
const instance = inject(headSymbol);
|
||||
if (instance) {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
||||
}
|
||||
function useHead(input, options = {}) {
|
||||
const head = options.head || /* @__PURE__ */ injectHead();
|
||||
return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
|
||||
}
|
||||
function clientUseHead(head, input, options = {}) {
|
||||
const deactivated = ref(false);
|
||||
let entry;
|
||||
watchEffect(() => {
|
||||
const i = deactivated.value ? {} : walkResolver(input, VueResolver);
|
||||
if (entry) {
|
||||
entry.patch(i);
|
||||
} else {
|
||||
entry = head.push(i, options);
|
||||
}
|
||||
});
|
||||
const vm = getCurrentInstance();
|
||||
if (vm) {
|
||||
onBeforeUnmount(() => {
|
||||
entry.dispose();
|
||||
});
|
||||
onDeactivated(() => {
|
||||
deactivated.value = true;
|
||||
});
|
||||
onActivated(() => {
|
||||
deactivated.value = false;
|
||||
});
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
function useSeoMeta(input = {}, options = {}) {
|
||||
const head = options.head || /* @__PURE__ */ injectHead();
|
||||
head.use(FlatMetaPlugin);
|
||||
const { title, titleTemplate, ...meta } = input;
|
||||
return useHead({
|
||||
title,
|
||||
titleTemplate,
|
||||
_flatMeta: meta
|
||||
}, options);
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createHead(options = {}) {
|
||||
const head = createHead$1({
|
||||
...options,
|
||||
propResolvers: [VueResolver]
|
||||
});
|
||||
head.install = vueInstall(head);
|
||||
return head;
|
||||
}
|
||||
|
||||
const NUXT_PAYLOAD_EXTRACTION = true;
|
||||
|
||||
const appHead = {"meta":[{"charset":"utf-8"},{"name":"viewport","content":"width=device-width, initial-scale=1"},{"name":"description","content":"面向政府、医院与养老机构的智慧医养居家上门服务闭环管理平台"},{"name":"keywords","content":"智慧医养平台,居家养老上门服务系统,长护险服务管理,居家照护管理系统,养老服务监管平台"}],"link":[{"rel":"icon","type":"image/svg+xml","href":"/favicon.svg"}],"style":[],"script":[],"noscript":[],"titleTemplate":"%s | 智慧医养居家上门服务平台","htmlAttrs":{"lang":"zh-CN"}};
|
||||
|
||||
const appRootTag = "div";
|
||||
|
||||
const appRootAttrs = {"id":"__nuxt"};
|
||||
|
||||
const appTeleportTag = "div";
|
||||
|
||||
const appTeleportAttrs = {"id":"teleports"};
|
||||
|
||||
const appId = "nuxt-app";
|
||||
|
||||
function baseURL() {
|
||||
|
||||
return useRuntimeConfig().app.baseURL;
|
||||
}
|
||||
function buildAssetsDir() {
|
||||
|
||||
return useRuntimeConfig().app.buildAssetsDir;
|
||||
}
|
||||
function buildAssetsURL(...path) {
|
||||
return joinRelativeURL(publicAssetsURL(), buildAssetsDir(), ...path);
|
||||
}
|
||||
function publicAssetsURL(...path) {
|
||||
|
||||
const app = useRuntimeConfig().app;
|
||||
const publicBase = app.cdnURL || app.baseURL;
|
||||
return path.length ? joinRelativeURL(publicBase, ...path) : publicBase;
|
||||
}
|
||||
|
||||
// @ts-expect-error private property consumed by vite-generated url helpers
|
||||
globalThis.__buildAssetsURL = buildAssetsURL;
|
||||
// @ts-expect-error private property consumed by vite-generated url helpers
|
||||
globalThis.__publicAssetsURL = publicAssetsURL;
|
||||
const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
||||
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getServerEntry = () => import('../build/server.mjs').then((r) => r.default || r);
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getPrecomputedDependencies = () => import('../build/client.precomputed.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
||||
|
||||
const getSSRRenderer = lazyCachedFunction(async () => {
|
||||
|
||||
const createSSRApp = await getServerEntry();
|
||||
if (!createSSRApp) {
|
||||
throw new Error("Server bundle is not available");
|
||||
}
|
||||
|
||||
const precomputed = await getPrecomputedDependencies();
|
||||
|
||||
const renderer = createRenderer(createSSRApp, {
|
||||
precomputed,
|
||||
manifest: undefined,
|
||||
renderToString: renderToString$1,
|
||||
buildAssetsURL
|
||||
});
|
||||
async function renderToString$1(input, context) {
|
||||
const html = await renderToString(input, context);
|
||||
return APP_ROOT_OPEN_TAG + html + APP_ROOT_CLOSE_TAG;
|
||||
}
|
||||
return renderer;
|
||||
});
|
||||
|
||||
const getSPARenderer = lazyCachedFunction(async () => {
|
||||
const precomputed = await getPrecomputedDependencies();
|
||||
// @ts-expect-error virtual file
|
||||
const spaTemplate = await import('../virtual/_virtual_spa-template.mjs').then((r) => r.template).catch(() => "").then((r) => {
|
||||
{
|
||||
return APP_ROOT_OPEN_TAG + r + APP_ROOT_CLOSE_TAG;
|
||||
}
|
||||
});
|
||||
|
||||
const renderer = createRenderer(() => () => {}, {
|
||||
precomputed,
|
||||
manifest: undefined,
|
||||
renderToString: () => spaTemplate,
|
||||
buildAssetsURL
|
||||
});
|
||||
const result = await renderer.renderToString({});
|
||||
const renderToString = (ssrContext) => {
|
||||
const config = useRuntimeConfig(ssrContext.event);
|
||||
ssrContext.modules ||= new Set();
|
||||
ssrContext.payload.serverRendered = false;
|
||||
ssrContext.config = {
|
||||
public: config.public,
|
||||
app: config.app
|
||||
};
|
||||
return Promise.resolve(result);
|
||||
};
|
||||
return {
|
||||
rendererContext: renderer.rendererContext,
|
||||
renderToString
|
||||
};
|
||||
});
|
||||
function lazyCachedFunction(fn) {
|
||||
let res = null;
|
||||
return () => {
|
||||
if (res === null) {
|
||||
res = fn().catch((err) => {
|
||||
res = null;
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
||||
function getRenderer(ssrContext) {
|
||||
return ssrContext.noSSR ? getSPARenderer() : getSSRRenderer();
|
||||
}
|
||||
// @ts-expect-error file will be produced after app build
|
||||
const getSSRStyles = lazyCachedFunction(() => import('../build/styles.mjs').then((r) => r.default || r));
|
||||
|
||||
const prerenderRenderingURLs = new AsyncLocalStorage() ;
|
||||
const payloadCache = useStorage("internal:nuxt:prerender:payload") ;
|
||||
useStorage("internal:nuxt:prerender:island") ;
|
||||
useStorage("internal:nuxt:prerender:island-props") ;
|
||||
|
||||
function renderPayloadResponse(ssrContext) {
|
||||
return {
|
||||
body: encodeForwardSlashes(stringify(splitPayload(ssrContext).payload, ssrContext["~payloadReducers"])) ,
|
||||
statusCode: getResponseStatus(ssrContext.event),
|
||||
statusMessage: getResponseStatusText(ssrContext.event),
|
||||
headers: {
|
||||
"content-type": "application/json;charset=utf-8" ,
|
||||
"x-powered-by": "Nuxt"
|
||||
}
|
||||
};
|
||||
}
|
||||
function renderPayloadJsonScript(opts) {
|
||||
const contents = opts.data ? encodeForwardSlashes(stringify(opts.data, opts.ssrContext["~payloadReducers"])) : "";
|
||||
const payload = {
|
||||
"type": "application/json",
|
||||
"innerHTML": contents,
|
||||
"data-nuxt-data": appId,
|
||||
"data-ssr": !(opts.ssrContext.noSSR)
|
||||
};
|
||||
{
|
||||
payload.id = "__NUXT_DATA__";
|
||||
}
|
||||
if (opts.src) {
|
||||
payload["data-src"] = opts.src;
|
||||
}
|
||||
const config = uneval(opts.ssrContext.config);
|
||||
return [payload, { innerHTML: `window.__NUXT__={};window.__NUXT__.config=${config}` }];
|
||||
}
|
||||
|
||||
function encodeForwardSlashes(str) {
|
||||
return str.replaceAll("/", "\\u002F");
|
||||
}
|
||||
function splitPayload(ssrContext) {
|
||||
const { data, prerenderedAt, ...initial } = ssrContext.payload;
|
||||
return {
|
||||
initial: {
|
||||
...initial,
|
||||
prerenderedAt
|
||||
},
|
||||
payload: {
|
||||
data,
|
||||
prerenderedAt
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const unheadOptions = {
|
||||
disableDefaults: true,
|
||||
disableCapoSorting: false,
|
||||
plugins: [DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin],
|
||||
};
|
||||
|
||||
const PRERENDER_NO_SSR_ROUTES = new Set([
|
||||
"/index.html",
|
||||
"/200.html",
|
||||
"/404.html"
|
||||
]);
|
||||
|
||||
function encodeEventPath(path) {
|
||||
const queryIndex = path.indexOf("?");
|
||||
if (queryIndex === -1) {
|
||||
return encodePath(path);
|
||||
}
|
||||
return encodePath(path.slice(0, queryIndex)) + path.slice(queryIndex);
|
||||
}
|
||||
function createSSRContext(event) {
|
||||
const url = encodeEventPath(event.path);
|
||||
const ssrContext = {
|
||||
url,
|
||||
event,
|
||||
runtimeConfig: useRuntimeConfig(event),
|
||||
noSSR: event.context.nuxt?.noSSR || (PRERENDER_NO_SSR_ROUTES.has(url) ),
|
||||
head: createHead(unheadOptions),
|
||||
error: false,
|
||||
nuxt: undefined,
|
||||
payload: {},
|
||||
["~payloadReducers"]: Object.create(null),
|
||||
modules: new Set()
|
||||
};
|
||||
{
|
||||
ssrContext.payload.prerenderedAt = Date.now();
|
||||
}
|
||||
return ssrContext;
|
||||
}
|
||||
function setSSRError(ssrContext, error) {
|
||||
ssrContext.error = true;
|
||||
ssrContext.payload = { error };
|
||||
ssrContext.url = error.url;
|
||||
}
|
||||
|
||||
async function renderInlineStyles(usedModules) {
|
||||
const styleMap = await getSSRStyles();
|
||||
const inlinedStyles = new Set();
|
||||
for (const mod of usedModules) {
|
||||
if (mod in styleMap && styleMap[mod]) {
|
||||
for (const style of await styleMap[mod]()) {
|
||||
inlinedStyles.add(style);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Array.from(inlinedStyles).map((style) => ({ innerHTML: style }));
|
||||
}
|
||||
|
||||
const renderSSRHeadOptions = {"omitLineBreaks":false};
|
||||
|
||||
const entryIds = ["node_modules/nuxt/dist/app/entry.js"];
|
||||
|
||||
// @ts-expect-error private property consumed by vite-generated url helpers
|
||||
globalThis.__buildAssetsURL = buildAssetsURL;
|
||||
// @ts-expect-error private property consumed by vite-generated url helpers
|
||||
globalThis.__publicAssetsURL = publicAssetsURL;
|
||||
const HAS_APP_TELEPORTS = !!(appTeleportAttrs.id);
|
||||
const APP_TELEPORT_OPEN_TAG = HAS_APP_TELEPORTS ? `<${appTeleportTag}${propsToString(appTeleportAttrs)}>` : "";
|
||||
const APP_TELEPORT_CLOSE_TAG = HAS_APP_TELEPORTS ? `</${appTeleportTag}>` : "";
|
||||
const PAYLOAD_URL_RE = /^[^?]*\/_payload.json(?:\?.*)?$/ ;
|
||||
const PAYLOAD_FILENAME = "_payload.json" ;
|
||||
const handler = defineRenderHandler((event) => {
|
||||
|
||||
const ssrError = event.path.startsWith("/__nuxt_error") ? getQuery(event) : null;
|
||||
if (ssrError && !("__unenv__" in event.node.req)) {
|
||||
throw createError({
|
||||
status: 404,
|
||||
statusText: "Page Not Found: /__nuxt_error",
|
||||
message: "Page Not Found: /__nuxt_error"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (prerenderRenderingURLs) {
|
||||
const url = new URL(event.path, "http://localhost");
|
||||
const renderingURL = url.pathname + url.search;
|
||||
const stack = prerenderRenderingURLs.getStore();
|
||||
if (stack?.includes(renderingURL)) {
|
||||
const chain = [...stack, renderingURL].filter((u) => !u.startsWith("/__nuxt_error")).map((u) => `"${u}"`).join(" -> ");
|
||||
throw createError({
|
||||
status: 508,
|
||||
statusText: `Loop detected while prerendering "${renderingURL}" (${chain}). Check for \`useFetch\`/\`$fetch\` calls targeting a URL that is currently being rendered.`
|
||||
});
|
||||
}
|
||||
return prerenderRenderingURLs.run([...stack || [], renderingURL], () => renderRoute(event, ssrError));
|
||||
}
|
||||
return renderRoute(event, ssrError);
|
||||
});
|
||||
async function renderRoute(event, ssrError) {
|
||||
const nitroApp = useNitroApp();
|
||||
|
||||
const ssrContext = createSSRContext(event);
|
||||
|
||||
const headEntryOptions = { mode: "server" };
|
||||
ssrContext.head.push(appHead, headEntryOptions);
|
||||
if (ssrError) {
|
||||
|
||||
const status = ssrError.status || ssrError.statusCode;
|
||||
if (status) {
|
||||
|
||||
ssrError.status = ssrError.statusCode = Number.parseInt(status);
|
||||
}
|
||||
setSSRError(ssrContext, ssrError);
|
||||
}
|
||||
|
||||
const routeOptions = getRouteRules(event);
|
||||
|
||||
const _PAYLOAD_EXTRACTION = !ssrContext.noSSR && (NUXT_PAYLOAD_EXTRACTION);
|
||||
const isRenderingPayload = (_PAYLOAD_EXTRACTION || false) && PAYLOAD_URL_RE.test(ssrContext.url);
|
||||
if (isRenderingPayload) {
|
||||
const url = ssrContext.url.substring(0, ssrContext.url.lastIndexOf("/")) || "/";
|
||||
ssrContext.url = url;
|
||||
event._path = event.node.req.url = url;
|
||||
if (await payloadCache.hasItem(url)) {
|
||||
return payloadCache.getItem(url);
|
||||
}
|
||||
}
|
||||
if (routeOptions.ssr === false) {
|
||||
ssrContext.noSSR = true;
|
||||
}
|
||||
const payloadURL = _PAYLOAD_EXTRACTION ? joinURL(ssrContext.runtimeConfig.app.cdnURL || ssrContext.runtimeConfig.app.baseURL, ssrContext.url.replace(/\?.*$/, ""), PAYLOAD_FILENAME) + "?" + ssrContext.runtimeConfig.app.buildId : undefined;
|
||||
|
||||
const renderer = await getRenderer(ssrContext);
|
||||
{
|
||||
for (const id of entryIds) {
|
||||
ssrContext.modules.add(id);
|
||||
}
|
||||
}
|
||||
const _rendered = await renderer.renderToString(ssrContext).catch(async (error) => {
|
||||
|
||||
|
||||
if ((ssrContext["~renderResponse"] || ssrContext._renderResponse) && error.message === "skipping render") {
|
||||
return {};
|
||||
}
|
||||
|
||||
const _err = !ssrError && ssrContext.payload?.error || error;
|
||||
await ssrContext.nuxt?.hooks.callHook("app:error", _err);
|
||||
throw _err;
|
||||
});
|
||||
|
||||
|
||||
const inlinedStyles = !ssrContext["~renderResponse"] && !ssrContext._renderResponse && !isRenderingPayload ? await renderInlineStyles(ssrContext.modules ?? []) : [];
|
||||
await ssrContext.nuxt?.hooks.callHook("app:rendered", {
|
||||
ssrContext,
|
||||
renderResult: _rendered
|
||||
});
|
||||
if (ssrContext["~renderResponse"] || ssrContext._renderResponse) {
|
||||
|
||||
return ssrContext["~renderResponse"] || ssrContext._renderResponse;
|
||||
}
|
||||
|
||||
if (ssrContext.payload?.error && !ssrError) {
|
||||
throw ssrContext.payload.error;
|
||||
}
|
||||
|
||||
if (isRenderingPayload) {
|
||||
const response = renderPayloadResponse(ssrContext);
|
||||
{
|
||||
await payloadCache.setItem(ssrContext.url, response);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
if (_PAYLOAD_EXTRACTION && true) {
|
||||
|
||||
appendResponseHeader(event, "x-nitro-prerender", joinURL(ssrContext.url.replace(/\?.*$/, ""), PAYLOAD_FILENAME));
|
||||
|
||||
await payloadCache.setItem(ssrContext.url === "/" ? "/" : ssrContext.url.replace(/\/$/, ""), renderPayloadResponse(ssrContext));
|
||||
}
|
||||
const NO_SCRIPTS = routeOptions.noScripts;
|
||||
|
||||
const { styles, scripts } = getRequestDependencies(ssrContext, renderer.rendererContext);
|
||||
|
||||
if (_PAYLOAD_EXTRACTION && !NO_SCRIPTS) {
|
||||
ssrContext.head.push({ link: [{
|
||||
rel: "preload",
|
||||
as: "fetch",
|
||||
crossorigin: "anonymous",
|
||||
href: payloadURL
|
||||
} ] }, headEntryOptions);
|
||||
}
|
||||
if (ssrContext["~preloadManifest"] && !NO_SCRIPTS) {
|
||||
ssrContext.head.push({ link: [{
|
||||
rel: "preload",
|
||||
as: "fetch",
|
||||
fetchpriority: "low",
|
||||
crossorigin: "anonymous",
|
||||
href: buildAssetsURL(`builds/meta/${ssrContext.runtimeConfig.app.buildId}.json`)
|
||||
}] }, {
|
||||
...headEntryOptions,
|
||||
tagPriority: "low"
|
||||
});
|
||||
}
|
||||
|
||||
if (inlinedStyles.length) {
|
||||
ssrContext.head.push({ style: inlinedStyles });
|
||||
}
|
||||
const link = [];
|
||||
for (const resource of Object.values(styles)) {
|
||||
|
||||
|
||||
|
||||
link.push({
|
||||
rel: "stylesheet",
|
||||
href: renderer.rendererContext.buildAssetsURL(resource.file),
|
||||
crossorigin: ""
|
||||
});
|
||||
}
|
||||
if (link.length) {
|
||||
ssrContext.head.push({ link }, headEntryOptions);
|
||||
}
|
||||
if (!NO_SCRIPTS) {
|
||||
|
||||
|
||||
|
||||
if (ssrContext["~lazyHydratedModules"]) {
|
||||
for (const id of ssrContext["~lazyHydratedModules"]) {
|
||||
ssrContext.modules?.delete(id);
|
||||
}
|
||||
}
|
||||
|
||||
ssrContext.head.push({ link: getPreloadLinks(ssrContext, renderer.rendererContext) }, headEntryOptions);
|
||||
ssrContext.head.push({ link: getPrefetchLinks(ssrContext, renderer.rendererContext) }, headEntryOptions);
|
||||
|
||||
ssrContext.head.push({ script: _PAYLOAD_EXTRACTION ? renderPayloadJsonScript({
|
||||
ssrContext,
|
||||
data: splitPayload(ssrContext).initial,
|
||||
src: payloadURL
|
||||
}) : renderPayloadJsonScript({
|
||||
ssrContext,
|
||||
data: ssrContext.payload
|
||||
}) }, {
|
||||
...headEntryOptions,
|
||||
|
||||
tagPosition: "bodyClose",
|
||||
tagPriority: "high"
|
||||
});
|
||||
}
|
||||
|
||||
if (!routeOptions.noScripts) {
|
||||
const tagPosition = "head";
|
||||
ssrContext.head.push({ script: Object.values(scripts).map((resource) => ({
|
||||
type: resource.module ? "module" : null,
|
||||
src: renderer.rendererContext.buildAssetsURL(resource.file),
|
||||
defer: resource.module ? null : true,
|
||||
|
||||
|
||||
tagPosition,
|
||||
crossorigin: ""
|
||||
})) }, headEntryOptions);
|
||||
}
|
||||
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(ssrContext.head, renderSSRHeadOptions);
|
||||
|
||||
const htmlContext = {
|
||||
htmlAttrs: htmlAttrs ? [htmlAttrs] : [],
|
||||
head: normalizeChunks([headTags]),
|
||||
bodyAttrs: bodyAttrs ? [bodyAttrs] : [],
|
||||
bodyPrepend: normalizeChunks([bodyTagsOpen, ssrContext.teleports?.body]),
|
||||
body: [_rendered.html, APP_TELEPORT_OPEN_TAG + (HAS_APP_TELEPORTS ? joinTags([ssrContext.teleports?.[`#${appTeleportAttrs.id}`]]) : "") + APP_TELEPORT_CLOSE_TAG],
|
||||
bodyAppend: [bodyTags]
|
||||
};
|
||||
|
||||
await nitroApp.hooks.callHook("render:html", htmlContext, { event });
|
||||
|
||||
return {
|
||||
body: renderHTMLDocument(htmlContext),
|
||||
statusCode: getResponseStatus(event),
|
||||
statusMessage: getResponseStatusText(event),
|
||||
headers: {
|
||||
"content-type": "text/html;charset=utf-8",
|
||||
"x-powered-by": "Nuxt"
|
||||
}
|
||||
};
|
||||
}
|
||||
function normalizeChunks(chunks) {
|
||||
const result = [];
|
||||
for (const _chunk of chunks) {
|
||||
const chunk = _chunk?.trim();
|
||||
if (chunk) {
|
||||
result.push(chunk);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function joinTags(tags) {
|
||||
return tags.join("");
|
||||
}
|
||||
function joinAttrs(chunks) {
|
||||
if (chunks.length === 0) {
|
||||
return "";
|
||||
}
|
||||
return " " + chunks.join(" ");
|
||||
}
|
||||
function renderHTMLDocument(html) {
|
||||
return "<!DOCTYPE html>" + `<html${joinAttrs(html.htmlAttrs)}>` + `<head>${joinTags(html.head)}</head>` + `<body${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body>` + "</html>";
|
||||
}
|
||||
|
||||
const renderer = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
||||
__proto__: null,
|
||||
default: handler
|
||||
}, Symbol.toStringTag, { value: 'Module' }));
|
||||
|
||||
export { useSeoMeta as a, baseURL as b, headSymbol as h, renderer as r, useHead as u };
|
||||
//# sourceMappingURL=renderer.mjs.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"renderer.mjs","sources":["../../../../node_modules/@unhead/vue/dist/shared/vue.N9zWjxoK.mjs","../../../../node_modules/@unhead/vue/dist/shared/vue.Cr7xSEtD.mjs","../../../../node_modules/@unhead/vue/dist/server.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/paths.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/renderer/build-files.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/cache.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/renderer/payload.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/renderer/app.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/utils/renderer/inline-styles.mjs","../../../../node_modules/@nuxt/nitro-server/dist/runtime/handlers/renderer.mjs"],"names":["renderToString","_renderToString"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
||||
Reference in New Issue
Block a user