From df9c74ba16e0d56f40667d4616ff9ed39f7238d9 Mon Sep 17 00:00:00 2001 From: frankkeres Date: Thu, 24 Apr 2025 14:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9cspbug=E5=92=8C=E6=8D=A2?= =?UTF-8?q?=E4=BA=86=E6=96=B0=E7=9A=84gtmid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nuxt.config.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/nuxt.config.js b/nuxt.config.js index de500bc..a11dc66 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -6,7 +6,7 @@ export default { title: 'buddysCloud', script: [ { - src: 'https://www.googletagmanager.com/gtag/js?id=G-PMXV6BN06E', + src: 'https://www.googletagmanager.com/gtag/js?id=G-KNJFL438C1', async: true, }, { @@ -14,7 +14,7 @@ export default { window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); - gtag('config', 'G-PMXV6BN06E'); + gtag('config', 'G-KNJFL438C1'); `, type: 'text/javascript', }, @@ -72,7 +72,7 @@ export default { // '@nuxtjs/google-analytics' // ], gtm: { - id: 'GTM-PL75JP66', + id: 'GTM-5M5JNS4K', layer: 'dataLayer', pageTracking: false, // ✅ 关闭 GTM 的自动页面跟踪,避免和 GA 冲突 enabled: true @@ -87,5 +87,13 @@ export default { // }, // Build Configuration: https://go.nuxtjs.dev/config-build build: { + }, + render: { + csp: { + policies: { + 'script-src': ["'self'", "'unsafe-eval'"], + // 其他策略... + } + } } }