From 157f49592a3aed17e3a1dae9678ec466202d982e Mon Sep 17 00:00:00 2001 From: QLHazyCoder <2825305047@qq.com> Date: Tue, 21 Apr 2026 01:55:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E8=B4=A1=E7=8C=AE?= =?UTF-8?q?=E6=98=B5=E7=A7=B0=E9=80=BB=E8=BE=91=EF=BC=8C=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=95=99=E7=A9=BA=E6=98=B5=E7=A7=B0=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=B8=E5=85=B3=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- background.js | 2 +- background/contribution-oauth.js | 3 +-- sidepanel/sidepanel.html | 2 +- tests/background-contribution-mode.test.js | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/background.js b/background.js index b479a39..3795362 100644 --- a/background.js +++ b/background.js @@ -6619,7 +6619,7 @@ async function refreshOAuthUrlBeforeStep6(state) { if (state?.contributionMode && contributionOAuthManager?.startContributionFlow) { await addLog('步骤 7:contributionMode=true,走公开贡献接口,正在申请 OAuth 登录地址...', 'info'); const contributionState = await contributionOAuthManager.startContributionFlow({ - nickname: state.email, + nickname: state.contributionNickname || '', openAuthTab: false, stateOverride: state, }); diff --git a/background/contribution-oauth.js b/background/contribution-oauth.js index d5fc80d..7dc5608 100644 --- a/background/contribution-oauth.js +++ b/background/contribution-oauth.js @@ -247,9 +247,8 @@ function buildNickname(state = {}, preferredNickname = '') { const nickname = normalizeString(preferredNickname) - || normalizeString(state.email) || normalizeString(state.contributionNickname); - return nickname || 'codex-extension-user'; + return nickname || ''; } function buildContributionQq(state = {}, preferredQq = '') { diff --git a/sidepanel/sidepanel.html b/sidepanel/sidepanel.html index 5f73343..38c650a 100644 --- a/sidepanel/sidepanel.html +++ b/sidepanel/sidepanel.html @@ -112,7 +112,7 @@

当前账号将用于支持项目维护。扩展会自动申请贡献登录地址并持续跟踪授权状态;如检测到回调地址,会自动提交,无需手动复制。

贡献昵称 - +
QQ diff --git a/tests/background-contribution-mode.test.js b/tests/background-contribution-mode.test.js index e30c482..b3d6901 100644 --- a/tests/background-contribution-mode.test.js +++ b/tests/background-contribution-mode.test.js @@ -421,7 +421,7 @@ test('contribution oauth manager starts session, opens auth url, submits callbac assert.equal(startedState.contributionAuthTabId, 88); assert.equal(tabCalls.length, 1); assert.match(fetchCalls[0].url, /\/start$/); - assert.match(String(fetchCalls[0].options.body || ''), /"nickname":"user@example\.com"/); + assert.match(String(fetchCalls[0].options.body || ''), /"nickname":""/); assert.match(String(fetchCalls[0].options.body || ''), /"qq":""/); assert.match(fetchCalls[1].url, /\/status\?/); @@ -511,7 +511,7 @@ return { refreshOAuthUrlBeforeStep6 }; { type: 'contribution', options: { - nickname: 'user@example.com', + nickname: '', openAuthTab: false, stateOverride: { contributionMode: true,