22 <Sidebar >
33 <template #top >
44 <div class =" ss" >
5- <div class =" sidebar-ad-placeholder" >
6- <a href =" https://doc.hutool .cn/" target =" _blank" @click =" handleAdClick" >
7- <img src =" /img/ss/hutool.pic.jpg " alt =" Hutool" style =" max-width : 80% ; height : auto ; margin-left : 20px ;" />
5+ <div class =" sidebar-ad-placeholder" style = " margin-top : 25 px ; " >
6+ <a href =" https://e.tb .cn/h.SIXPWhPqkQZSEGW?tk=LGSzfiLOCB1 " target =" _blank" @click =" handleAdClick('alist-115') " >
7+ <img : src =" adImage " alt =" Hutool" style =" max-width : 80% ; height : auto ; margin-left : 20px ;" />
88 </a >
99 </div >
10- <!-- <div class="sidebar-ad-placeholder">
11- 广告 2
10+ <div class =" sidebar-ad-placeholder" >
11+ <a href =" https://doc.hutool.cn/" target =" _blank" @click =" handleAdClick('alist-hutool')" >
12+ <img src =" /img/ss/hutool.pic.jpg" alt =" Hutool" style =" max-width : 80% ; height : auto ; margin-left : 20px ;" />
13+ </a >
1214 </div >
13- <div class="sidebar-ad-placeholder">
14- 广告 3
15- </div> -->
15+
1616 <div class =" mingdao" v-if =" showMingdao" >
1717 <a href =" https://www.mingdao.com?s=utm_51=utm_source=alist&utm_medium=banner&utm_campaign=%E5%93%81%E7%89%8C%E6%8E%A8%E5%B9%BF&utm_content=IT%E8%B5%8B%E8%83%BD%E4%B8%9A%E5%8A%A1"
1818 target =" _blank" ><img src =" /img/ss/mingdao.png" alt =" " /></a >
@@ -44,15 +44,21 @@ const isDrivers = computed(() => {
4444
4545const showMingdao = false ;
4646
47- const handleAdClick = async () => {
47+ const isChinese = computed (() => {
48+ return pageData .value .path .startsWith (" /zh/" )
49+ })
50+ const adImage = computed (() => isChinese .value ? ' /img/ss/115-cn.jpg' : ' /img/ss/115-en.jpg' )
51+
52+
53+ const handleAdClick = async (name : string ) => {
4854 try {
4955 await fetch (' https://api.hutool.cn/blade-adv/stats' , {
5056 method: ' POST' ,
5157 headers: {
5258 ' Content-Type' : ' application/json' ,
5359 },
5460 body: JSON .stringify ({
55- name: " alist-hutool "
61+ name: name
5662 })
5763 });
5864 } catch (error ) {
@@ -66,8 +72,7 @@ const handleAdClick = async () => {
6672 width : 100% ;
6773 display : flex ;
6874 justify-content : flex-end ;
69- margin : 35px 0 16px 0 ;
70- border-radius : 5px ;
75+ margin : -12px 0 16px 0 ;
7176}
7277
7378.mingdao {
0 commit comments