Skip to content

Commit cbe2cb9

Browse files
committed
fix: Click on the ad call interface
1 parent 5a6df38 commit cbe2cb9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/.vuepress/components/Sidebar.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<template #top>
44
<div class="ss">
55
<div class="sidebar-ad-placeholder">
6-
<a href="https://doc.hutool.cn/" target="_blank">
6+
<a href="https://doc.hutool.cn/" target="_blank" @click="handleAdClick">
77
<img src="/img/ss/hutool.pic.jpg" alt="Hutool" style="max-width: 90%; height: auto;" />
88
</a>
99
</div>
@@ -43,6 +43,22 @@ const isDrivers = computed(() => {
4343
});
4444
4545
const showMingdao = false;
46+
47+
const handleAdClick = async () => {
48+
try {
49+
await fetch('https://api.hutool.cn/blade-adv/stats', {
50+
method: 'POST',
51+
headers: {
52+
'Content-Type': 'application/json',
53+
},
54+
body: JSON.stringify({
55+
name: "hutool"
56+
})
57+
});
58+
} catch (error) {
59+
console.error('广告统计请求失败:', error);
60+
}
61+
};
4662
</script>
4763

4864
<style scoped lang="scss">

0 commit comments

Comments
 (0)