This commit is contained in:
@ -1,6 +1,19 @@
|
||||
---
|
||||
import BoringLayout from '../layout/BoringLayout.astro'
|
||||
import MainpageButton from '../components/MainpageButton.svelte'
|
||||
|
||||
import { mainpageGetClick } from '../lib/apis/legacy/mainpage'
|
||||
|
||||
// 无用按钮的数字预注入
|
||||
|
||||
let initialClicks = 0
|
||||
|
||||
try {
|
||||
const resp = await mainpageGetClick()
|
||||
initialClicks = resp.data
|
||||
} catch (e) {
|
||||
console.error('在获取点击数量时失败了', e)
|
||||
}
|
||||
---
|
||||
|
||||
<BoringLayout>
|
||||
@ -8,5 +21,5 @@ import MainpageButton from '../components/MainpageButton.svelte'
|
||||
<p>点击 <a href="https://legacy.passthem.top">这里</a> 查看旧版博客</p>
|
||||
<p>或者了解更多 <a href="/about">关于这里</a></p>
|
||||
<p>也欢迎你来 <a href="/contact">联络我</a></p>
|
||||
<p><MainpageButton client:only /></p>
|
||||
<p><MainpageButton initialClicks={initialClicks} client:load /></p>
|
||||
</BoringLayout>
|
||||
|
||||
Reference in New Issue
Block a user