From 1cca8d26afdd5a415ee757e9977f8b722acbd561 Mon Sep 17 00:00:00 2001 From: KDZhu Date: Sun, 29 Sep 2024 14:22:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(v-html):=20=E8=BF=87=E6=BB=A4v-html?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=98=B2=E8=8C=83XSS=E6=94=BB=E5=87=BB=20#?= =?UTF-8?q?=20Reviewed,=20transaction=20id:=2019674?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dashboard-front/package.json | 1 + .../src/components/version-diff/index.vue | 10 +++++----- src/dashboard-front/src/main.ts | 2 ++ .../views/apiDocs/components/component-searcher.vue | 4 ++-- .../apiDocs/components/doc-detail-main-content.vue | 2 +- .../apiDocs/components/sdk-instruction-content.vue | 2 +- src/dashboard-front/src/views/apiDocs/doc-detail.vue | 4 ++-- .../src/views/apigwDocs/components/detail.vue | 4 ++-- .../src/views/apigwDocs/components/doc.vue | 4 ++-- src/dashboard-front/src/views/basic-info/index.vue | 2 +- .../src/views/component-doc/components/detail.vue | 8 ++++---- .../src/views/component-doc/components/doc.vue | 4 ++-- .../component-doc/components/searcher/index.vue | 4 ++-- .../manage/components/render-system.vue | 4 ++-- .../manage/components/sync-access.vue | 6 +++--- .../src/views/components-access/system/index.vue | 2 +- .../views/components/plugin-manage/plugin-info.vue | 2 +- .../views/components/resource-doc-slider/index.vue | 2 +- .../src/views/components/resources-doc/index.vue | 2 +- src/dashboard-front/src/views/home.vue | 2 +- .../src/views/online-debug/components/doc.vue | 4 ++-- src/dashboard-front/src/views/online-debug/index.vue | 4 ++-- .../src/views/operate-data/access-log/detail.vue | 2 +- .../resource/version/components/resourceDetail.vue | 2 +- .../src/views/sdk/components/sdk-detail.vue | 2 +- src/dashboard-front/yarn.lock | 12 ++++++++++++ 26 files changed, 56 insertions(+), 41 deletions(-) diff --git a/src/dashboard-front/package.json b/src/dashboard-front/package.json index e5916225a..5cb297b95 100644 --- a/src/dashboard-front/package.json +++ b/src/dashboard-front/package.json @@ -57,6 +57,7 @@ "semver": "^7.6.3", "transliteration": "^2.3.5", "vue": "^3.4.38", + "vue-dompurify-html": "^5.1.0", "vue-i18n": "^9.14.0", "vue-router": "^4.4.3" }, diff --git a/src/dashboard-front/src/components/version-diff/index.vue b/src/dashboard-front/src/components/version-diff/index.vue index 564e0e7ff..1dd5a9a68 100644 --- a/src/dashboard-front/src/components/version-diff/index.vue +++ b/src/dashboard-front/src/components/version-diff/index.vue @@ -217,7 +217,7 @@ @@ -249,7 +249,7 @@ @@ -275,7 +275,7 @@ @@ -311,7 +311,7 @@ @@ -340,7 +340,7 @@ diff --git a/src/dashboard-front/src/main.ts b/src/dashboard-front/src/main.ts index 8bd8390b7..eb2d239a0 100644 --- a/src/dashboard-front/src/main.ts +++ b/src/dashboard-front/src/main.ts @@ -8,6 +8,7 @@ import globalConfig from '@/constant/config'; import directive from '@/directive/index'; import mavonEditor from 'mavon-editor'; import 'mavon-editor/dist/css/index.css'; +import VueDOMPurifyHTML from 'vue-dompurify-html'; // 全量引入 bkui-vue import bkui from 'bkui-vue'; @@ -29,4 +30,5 @@ app.use(i18n) // .directive('overflowTitle', overflowTitle) // .directive('bkTooltips', bkTooltips) .use(mavonEditor) + .use(VueDOMPurifyHTML) .mount('.app'); diff --git a/src/dashboard-front/src/views/apiDocs/components/component-searcher.vue b/src/dashboard-front/src/views/apiDocs/components/component-searcher.vue index a7fbe6dd5..74b2d8c45 100644 --- a/src/dashboard-front/src/views/apiDocs/components/component-searcher.vue +++ b/src/dashboard-front/src/views/apiDocs/components/component-searcher.vue @@ -30,9 +30,9 @@

- + - +

{{ item.description || t('暂无描述') }}

diff --git a/src/dashboard-front/src/views/apiDocs/components/doc-detail-main-content.vue b/src/dashboard-front/src/views/apiDocs/components/doc-detail-main-content.vue index 87ed56899..c089d78d7 100644 --- a/src/dashboard-front/src/views/apiDocs/components/doc-detail-main-content.vue +++ b/src/dashboard-front/src/views/apiDocs/components/doc-detail-main-content.vue @@ -52,7 +52,7 @@
-
+
diff --git a/src/dashboard-front/src/views/apiDocs/components/sdk-instruction-content.vue b/src/dashboard-front/src/views/apiDocs/components/sdk-instruction-content.vue index 575ac83d5..a7be9af6f 100644 --- a/src/dashboard-front/src/views/apiDocs/components/sdk-instruction-content.vue +++ b/src/dashboard-front/src/views/apiDocs/components/sdk-instruction-content.vue @@ -13,7 +13,7 @@ Python -
+
-
-
+