From c1b89cab1a210b03137298d56f3c9d7aa5eedafb Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Mon, 27 Jul 2026 16:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BB=8Egit=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E8=B4=A1=E7=8C=AE=E8=80=85=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gfdgd_xi <3025613752@qq.com> --- src/components/SubmitterWindow.vue | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/SubmitterWindow.vue b/src/components/SubmitterWindow.vue index 2fcb9476..9b19221e 100644 --- a/src/components/SubmitterWindow.vue +++ b/src/components/SubmitterWindow.vue @@ -868,6 +868,23 @@ const isValidUrl = (url: string): boolean => { } }; +const getContributorFromGit = async (): Promise => { + try { + const nameResult = await window.ipcRenderer.invoke("get-git-name"); + const emailResult = await window.ipcRenderer.invoke("get-git-email"); + + const name = nameResult?.success ? nameResult.data : ""; + const email = emailResult?.success ? emailResult.data : ""; + + if (name && email) { + return `${name} <${email}>`; + } + } catch (error) { + console.warn("[Submitter] Failed to get git config:", error); + } + return ""; +}; + const isFormValid = computed(() => { const hasRequiredFields = formData.name.trim() && @@ -1345,6 +1362,12 @@ const parseDebFileAndSearchHistory = async (debPath: string) => { JSON.stringify(formData, null, 2), ); + const gitContributor = await getContributorFromGit(); + if (gitContributor) { + formData.contributor = gitContributor; + console.log("[Submitter] Contributor updated from git:", gitContributor); + } + if (formData.pkgname) { isSearchingHistory.value = true; try { @@ -1460,7 +1483,9 @@ const selectArch = async (arch: HistoryArchInfo) => { formData.name = arch.name || formData.name; formData.author = arch.author || formData.author; - formData.contributor = arch.contributor || formData.contributor; + if (!formData.contributor) { + formData.contributor = arch.contributor || ""; + } formData.website = arch.website || formData.website; formData.category = arch.category || formData.category; formData.description = arch.more || formData.description;