Merge pull request #534 from docmirror/copilot/fix-github-star-issue
通过缓存机制修复 GitHub star 徽章速率限制错误release-2.0.1
commit
c2c102795b
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue