import { _ as __nuxt_component_0 } from './HeaderImage-92nFA80c.mjs'; import { defineComponent, computed, withAsyncContext, mergeProps, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderComponent, ssrRenderAttr, ssrInterpolate } from 'vue/server-renderer'; import { _ as _imports_0 } from './virtual_public-Ch4_18y6.mjs'; import { u as useRequest } from './useRequest-pSRZvR3u.mjs'; import { u as useRoute } from './server.mjs'; import { u as useAsyncData } from './asyncData-D5wEK86T.mjs'; import { u as useSeoMeta } from './composables-2BFBRDmB.mjs'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import 'unhead/server'; import 'devalue'; import 'unhead/plugins'; import 'unhead/utils'; import 'vue-router'; import 'axios'; import 'perfect-debounce'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "[id]", __ssrInlineRender: true, async setup(__props) { let __temp, __restore; const route = useRoute(); const request = useRequest(); const id = computed(() => String(route.params.id ?? "")); const { data: detailRes, pending } = ([__temp, __restore] = withAsyncContext(async () => useAsyncData( () => `news-detail-${id.value}`, async () => { if (!id.value) return null; return await request.get(`/api/news/${id.value}`); }, { watch: [id] } )), __temp = await __temp, __restore(), __temp); const detail = computed(() => { const res = detailRes.value; return res?.code === 200 ? res.data : null; }); function formatDate(str) { if (!str) return ""; return str.split(" ")[0] ?? str; } useSeoMeta({ title: () => detail.value?.title ?? "企业资讯", description: () => detail.value?.description ?? "", ogTitle: () => detail.value?.title ?? "", ogDescription: () => detail.value?.description ?? "", ogImage: () => detail.value?.cover ?? void 0 }); return (_ctx, _push, _parent, _attrs) => { const _component_HeaderImage = __nuxt_component_0; _push(``); _push(ssrRenderComponent(_component_HeaderImage, { title: "企业资讯", img: "/images/企业资讯/企业资讯.png" }, null, _parent)); _push(`
`); if (unref(detail)) { _push(`

${ssrInterpolate(unref(detail).title)}

发布时间:${ssrInterpolate(formatDate(unref(detail).published_at))}
`); if (unref(detail).cover) { _push(``); } else { _push(``); } if (unref(detail).content) { _push(`
${unref(detail).content ?? ""}
`); } else { _push(``); } _push(``); } else if (!unref(pending)) { _push(`

暂无内容

`); } else { _push(``); } _push(`
`); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/news/[id].vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=_id_-0mLHz3QR.mjs.map