From d862cad1a079c23c0b7d088c8a9510d55220a054 Mon Sep 17 00:00:00 2001 From: kk <875203880@qq.com> Date: Wed, 15 Jul 2026 18:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=88=E6=9D=83=E5=9B=9E=E8=B0=83=E6=97=B6co?= =?UTF-8?q?de=E5=8F=82=E6=95=B0=E5=90=8D=E6=94=AF=E6=8C=81=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AE=9D=E7=9A=84auth=5Fcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/auth/loading.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/auth/loading.vue b/src/pages/auth/loading.vue index e2f6182..49242d0 100644 --- a/src/pages/auth/loading.vue +++ b/src/pages/auth/loading.vue @@ -30,10 +30,11 @@ export default { } // 从 URL 参数获取 code(App.vue 跳转时带过来) - let code = options.code || ''; + // 支付宝回调参数名是 auth_code,微信是 code + let code = options.code || options.auth_code || ''; if (!code) { const urlParams = new URLSearchParams(window.location.search); - code = urlParams.get('code') || ''; + code = urlParams.get('code') || urlParams.get('auth_code') || ''; } // 兜底:从 localStorage 恢复(页面复用时 onLoad 不触发,localStorage 由跳转函数清理) @@ -155,6 +156,7 @@ export default { // 立即清除 URL 中的 code 参数,避免刷新重复处理 const url = new URL(window.location.href); url.searchParams.delete('code'); + url.searchParams.delete('auth_code'); url.searchParams.delete('state'); window.history.replaceState({}, '', url.toString()); @@ -316,6 +318,7 @@ export default { // 立即清除 URL 中的 code/action 参数,避免刷新重复处理 const url = new URL(window.location.href); url.searchParams.delete('code'); + url.searchParams.delete('auth_code'); url.searchParams.delete('state'); url.searchParams.delete('action'); window.history.replaceState({}, '', url.toString());