Skip to content

Commit cabab21

Browse files
committed
1 parent decd464 commit cabab21

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/layouts/BaseLayout.astro

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ const { description, keywords, title, canonical, ogType } = Astro.props;
127127
});
128128
</script>
129129

130+
131+
<script>
132+
window.onload = () => {
133+
// 获取完整的来源 URL
134+
let referrer = document.referrer;
135+
console.log("来源ts测试:", referrer);
136+
};
137+
</script>
138+
130139
<style>
131140
* {
132141
box-sizing: border-box; /* 确保所有元素的宽高包含 padding 和 border */

src/pages/index.astro

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ import BaseLayout from "../layouts/BaseLayout.astro";
1818
</div>
1919
</BaseLayout>
2020

21-
<script>
22-
window.onload = () => {
23-
// 获取完整的来源 URL
24-
let referrer = document.referrer;
25-
console.log("来源ts测试:", referrer);
26-
};
27-
</script>
28-
2921
<!-- <script>
3022
import { ToastMessageEvent } from "../utils/types";
3123

0 commit comments

Comments
 (0)