Skip to content

Commit

Permalink
网站统计改为umami
Browse files Browse the repository at this point in the history
  • Loading branch information
jooooock committed Nov 12, 2024
1 parent cc7ea15 commit 36a7de7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
12 changes: 11 additions & 1 deletion app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

<script setup lang="ts">
const isDev = !import.meta.env.PROD
const runtimeConfig = useRuntimeConfig()
const websiteID = runtimeConfig.public.umamiWebsiteID
console.log(websiteID)
if (!useLoginAccount().value) {
navigateTo('/login', {replace: true})
Expand All @@ -25,7 +29,13 @@ useHead({
script: [
{
src: '/unregister.js',
}
},
websiteID ?
{
src: 'https://cloud.umami.is/script.js',
defer: true,
'data-website-id': websiteID
} : '',
]
})
</script>
Expand Down
10 changes: 6 additions & 4 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: false },
modules: ['@vueuse/nuxt', "@nuxt/ui", "nuxt-gtag"],
modules: ['@vueuse/nuxt', "@nuxt/ui"],
ssr: false,
gtag: {
id: 'G-8V3EBLSR2X'
},
runtimeConfig: {
public: {
umamiWebsiteID: '',
}
}
})

0 comments on commit 36a7de7

Please sign in to comment.