Merge pull request #534 from docmirror/copilot/fix-github-star-issue

通过缓存机制修复 GitHub star 徽章速率限制错误
release-2.0.1
Cute Omega 2025-11-15 23:18:24 +08:00 committed by GitHub
commit c2c102795b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -50,6 +50,11 @@ export default {
}
return false
},
githubStarBadgeUrl () {
// API
const today = new Date().toISOString().split('T')[0] // YYYY-MM-DD
return `https://img.shields.io/github/stars/docmirror/dev-sidecar?logo=github&cacheSeconds=86400&t=${today}`
},
},
async created () {
await this.doCheckRootCa()
@ -354,7 +359,7 @@ export default {
</div>
<a @click="openExternal('https://github.com/docmirror/dev-sidecar')"><img
alt="GitHub stars"
src="https://img.shields.io/github/stars/docmirror/dev-sidecar?logo=github"
:src="githubStarBadgeUrl"
></a>
</div>
</div>