diff --git a/.env.example b/.env.example index 58088e4..7a4ac4c 100644 --- a/.env.example +++ b/.env.example @@ -4,4 +4,6 @@ NUXT_PUBLIC_AUTHOR=John Doe NUXT_PUBLIC_SITE_NAME="John's Blog" NUXT_PUBLIC_BUILD_BASE_URL=/ # Fonts, please preserve last slash -NUXT_PUBLIC_FONTS_URL=https://fonts.example.com/ \ No newline at end of file +NUXT_PUBLIC_FONTS_URL=https://fonts.example.com/ + +NUXT_PUBLIC_BANNER_DATA_URL=https://example.com/api/web/banner/latest \ No newline at end of file diff --git a/app/components/web-dismissible-global-banner.vue b/app/components/web-dismissible-global-banner.vue index 4930b51..42fb992 100644 --- a/app/components/web-dismissible-global-banner.vue +++ b/app/components/web-dismissible-global-banner.vue @@ -21,6 +21,12 @@ const visible = ref(false) const STORAGE_KEY_DISMISSED = 'web_banner_dismissed' const STORAGE_KEY_LAST_ID = 'web_banner_last_id' +const props = defineProps<{ + dataUrl: string; +}>(); + +const webBannerDataUrl = props.dataUrl; + function getStorageItem(key: string): string | null { if (typeof window === 'undefined') return null return localStorage.getItem(key) @@ -45,7 +51,7 @@ interface WebBannerData { onMounted(async () => { try { - const data = await $fetch('https://files.techit.win/files/config/web/banner/tmp/index.json') + const data = await $fetch(webBannerDataUrl) if (!data) return diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 5c60962..53059b3 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -1,10 +1,11 @@