mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-06 20:32:55 +08:00
feat: pages: add Cloudflare Web Analytics
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
VITE_API_BASE=https://temp-email-api.xxx.xxx
|
VITE_API_BASE=https://temp-email-api.xxx.xxx
|
||||||
|
VITE_CF_WEB_ANALY_TOKEN=
|
||||||
|
|||||||
@@ -64,6 +64,16 @@ const newEmail = async () => {
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await refresh();
|
await refresh();
|
||||||
|
const token = import.meta.env.VITE_CF_WEB_ANALY_TOKEN;
|
||||||
|
|
||||||
|
if (token) {
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.defer = true;
|
||||||
|
script.src = 'https://static.cloudflareinsights.com/beacon.min.js';
|
||||||
|
script.dataset.cfBeacon = `{ token: ${token} }`;
|
||||||
|
document.body.appendChild(script);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user