From 37d1ca614712ae90dfdf9ce490dd22b5c25d95c4 Mon Sep 17 00:00:00 2001 From: QLHazyCoder <2825305047@qq.com> Date: Fri, 24 Apr 2026 10:29:37 +0800 Subject: [PATCH 01/12] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E8=B4=A1?= =?UTF-8?q?=E7=8C=AE=E6=A8=A1=E5=BC=8F=E7=9B=B8=E5=85=B3URL=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E4=BC=A0=E9=A1=B5=E9=9D=A2=E5=92=8C?= =?UTF-8?q?=E5=AE=98=E7=BD=91=E9=A1=B5=E9=9D=A2=E7=9A=84=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sidepanel/contribution-mode.js | 19 ++++- sidepanel/sidepanel.html | 94 ++++++++++++--------- sidepanel/sidepanel.js | 5 +- tests/sidepanel-contribution-button.test.js | 2 +- tests/sidepanel-contribution-mode.test.js | 5 +- 5 files changed, 79 insertions(+), 46 deletions(-) diff --git a/sidepanel/contribution-mode.js b/sidepanel/contribution-mode.js index c54081c..d6331b5 100644 --- a/sidepanel/contribution-mode.js +++ b/sidepanel/contribution-mode.js @@ -12,7 +12,8 @@ constants = {}, } = context; - const contributionUploadUrl = constants.contributionUploadUrl || 'https://apikey.qzz.io'; + const contributionPortalUrl = constants.contributionPortalUrl || 'https://apikey.qzz.io'; + const contributionUploadUrl = constants.contributionUploadUrl || 'https://apikey.qzz.io/upload'; const pollIntervalMs = Math.max(1500, Math.floor(Number(constants.pollIntervalMs) || 2500)); const hiddenRows = [ @@ -175,10 +176,22 @@ return normalizeString(currentState.contributionStatusMessage) || DEFAULT_COPY; } + function getContributionPortalPageUrl() { + return normalizeString(contributionPortalUrl); + } + function getContributionUploadPageUrl() { return normalizeString(contributionUploadUrl); } + function openContributionPortalPage() { + const targetUrl = getContributionPortalPageUrl(); + if (!targetUrl) { + return; + } + helpers.openExternalUrl?.(targetUrl); + } + function openContributionUploadPage() { const targetUrl = getContributionUploadPageUrl(); if (!targetUrl) { @@ -375,9 +388,9 @@ } actionInFlight = true; try { - openContributionUploadPage(); + openContributionPortalPage(); } catch (error) { - helpers.showToast?.(`打开上传页面失败:${error.message}`, 'error'); + helpers.showToast?.(`打开官网页面失败:${error.message}`, 'error'); } render(); try { diff --git a/sidepanel/sidepanel.html b/sidepanel/sidepanel.html index 63f7ab0..b400c81 100644 --- a/sidepanel/sidepanel.html +++ b/sidepanel/sidepanel.html @@ -16,8 +16,7 @@