From 5a2990770cb31e1b3c0cb95653ec03a181955008 Mon Sep 17 00:00:00 2001 From: snowykami Date: Mon, 2 Sep 2024 21:28:08 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20=E6=96=B0=E5=A2=9Egitea=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/scripts/statsApi.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/components/scripts/statsApi.ts b/docs/components/scripts/statsApi.ts index db4fc2f0..aedf1f99 100644 --- a/docs/components/scripts/statsApi.ts +++ b/docs/components/scripts/statsApi.ts @@ -84,16 +84,16 @@ async function getGithubStats() { } async function getRepoStats() { - // 两个接口各数据,哪个大取哪个 + // 两个接口各数据,加和返回 const githubStats = await getGithubStats(); const giteaStats = await getGiteaStats(); return { - stars: Math.max(githubStats.stars, giteaStats.stars), - forks: Math.max(githubStats.forks, giteaStats.forks), - watchers: Math.max(githubStats.watchers, giteaStats.watchers), - issues: Math.max(githubStats.issues, giteaStats.issues), - prs: Math.max(githubStats.prs, giteaStats.prs), - size: Math.max(githubStats.size, giteaStats.size), + stars: githubStats.stars + giteaStats.stars, + forks: githubStats.forks + giteaStats.forks, + watchers: githubStats.watchers + giteaStats.watchers, + issues: githubStats.issues + giteaStats.issues, + prs: githubStats.prs + giteaStats.prs, + size: githubStats.size + giteaStats.size, }; }