From 686acdd7c5c6716d6c31ea43c39f60f6b51453ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?= <8473136@qq.com> Date: Sun, 15 Sep 2024 10:31:21 +0800 Subject: [PATCH 1/6] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/api/github.ts | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/electron/api/github.ts b/electron/api/github.ts index 14dcaa6..41ec5d4 100644 --- a/electron/api/github.ts +++ b/electron/api/github.ts @@ -134,25 +134,29 @@ export const initGitHubApi = () => { log.info( `开始获取frp版本 当前架构:${currArch} 对应frp架构:${frpArch}` ); - const returnVersionsData = versions - .filter(f => getAdaptiveAsset(f.id)) - .map(m => { - const asset = getAdaptiveAsset(m.id); - const download_count = m.assets.reduce( - (sum, item) => sum + item.download_count, - 0 - ); - if (asset) { - const absPath = `${downloadPath}/${asset.name}`; - m.absPath = absPath; - m.download_completed = fs.existsSync(absPath); - m.download_count = download_count; - m.size = formatBytes(asset.size); - } - return m; - }); - // log.debug(`获取到frp版本:${JSON.stringify(returnVersionsData)}`) - event.reply("Download.frpVersionHook", returnVersionsData); + if (versions) { + const returnVersionsData = versions + .filter(f => getAdaptiveAsset(f.id)) + .map(m => { + const asset = getAdaptiveAsset(m.id); + const download_count = m.assets.reduce( + (sum, item) => sum + item.download_count, + 0 + ); + if (asset) { + const absPath = `${downloadPath}/${asset.name}`; + m.absPath = absPath; + m.download_completed = fs.existsSync(absPath); + m.download_count = download_count; + m.size = formatBytes(asset.size); + } + return m; + }); + // log.debug(`获取到frp版本:${JSON.stringify(returnVersionsData)}`) + event.reply("Download.frpVersionHook", returnVersionsData); + } else { + event.reply("Download.frpVersionHook", []); + } }); }); request.end(); From 6d5f985dfe8fe5f04e9446c2ea0ded46a817ae83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?= <8473136@qq.com> Date: Sun, 15 Sep 2024 10:47:48 +0800 Subject: [PATCH 2/6] =?UTF-8?q?:sparkles:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/proxy/index.vue | 66 +++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/src/views/proxy/index.vue b/src/views/proxy/index.vue index 59bf7d5..0519298 100644 --- a/src/views/proxy/index.vue +++ b/src/views/proxy/index.vue @@ -1,5 +1,12 @@