From 6d405b5367bba77dadb1065a47ac2813fa6ecb14 Mon Sep 17 00:00:00 2001 From: R2m1liA <15258427350@163.com> Date: Mon, 18 Aug 2025 17:16:35 +0800 Subject: [PATCH] =?UTF-8?q?Feature:=20=E6=96=B0=E5=A2=9E=E7=95=8C=E9=9D=A2?= =?UTF-8?q?-=E5=85=AC=E5=8F=B8=E7=AE=80=E4=BB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pages/about/contact-us.vue | 3 + app/pages/about/index.vue | 102 ++++++++++++++++++++++++++++++ app/pages/productions/example.vue | 95 ---------------------------- app/types/strapi/index.ts | 3 +- app/types/strapi/singleTypes.ts | 3 + app/utils/markdown.ts | 10 ++- 6 files changed, 118 insertions(+), 98 deletions(-) create mode 100644 app/pages/about/contact-us.vue create mode 100644 app/pages/about/index.vue delete mode 100644 app/pages/productions/example.vue create mode 100644 app/types/strapi/singleTypes.ts diff --git a/app/pages/about/contact-us.vue b/app/pages/about/contact-us.vue new file mode 100644 index 0000000..6f89abe --- /dev/null +++ b/app/pages/about/contact-us.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/app/pages/about/index.vue b/app/pages/about/index.vue new file mode 100644 index 0000000..1c41983 --- /dev/null +++ b/app/pages/about/index.vue @@ -0,0 +1,102 @@ + + + + + \ No newline at end of file diff --git a/app/pages/productions/example.vue b/app/pages/productions/example.vue deleted file mode 100644 index 53c4457..0000000 --- a/app/pages/productions/example.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/types/strapi/index.ts b/app/types/strapi/index.ts index 45240a7..c04ebf1 100644 --- a/app/types/strapi/index.ts +++ b/app/types/strapi/index.ts @@ -1,2 +1,3 @@ export * from './common'; -export * from './production'; \ No newline at end of file +export * from './production'; +export * from './singleTypes'; \ No newline at end of file diff --git a/app/types/strapi/singleTypes.ts b/app/types/strapi/singleTypes.ts new file mode 100644 index 0000000..77c5d3f --- /dev/null +++ b/app/types/strapi/singleTypes.ts @@ -0,0 +1,3 @@ +export interface StrapiCompanyProfile extends StrapiEntity { + content: string; +} \ No newline at end of file diff --git a/app/utils/markdown.ts b/app/utils/markdown.ts index 583f0a9..43431e8 100644 --- a/app/utils/markdown.ts +++ b/app/utils/markdown.ts @@ -1,5 +1,4 @@ import MarkdownIt from 'markdown-it'; -import DOMPurify from 'dompurify'; const md = new MarkdownIt({ html: true, @@ -10,6 +9,13 @@ const md = new MarkdownIt({ export function renderMarkdown(content: string): string { const dirtyHtml = md.render(content); - return DOMPurify.sanitize(dirtyHtml) + + if (typeof window !== 'undefined') { + import('dompurify').then((DOMPurify => { + return DOMPurify.default.sanitize(dirtyHtml) + })) + } + + return dirtyHtml }