From 86b93002f70e9291272de677189532964787a4a1 Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Mon, 7 Sep 2026 18:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/utils/auth-guard.js | 6 + core/utils/broadcast.js | 3 + pages/packing/packMode.vue | 1040 +++++++++++++++++++++++++++--------- 3 files changed, 809 insertions(+), 240 deletions(-) diff --git a/core/utils/auth-guard.js b/core/utils/auth-guard.js index 86ae510..2a14169 100644 --- a/core/utils/auth-guard.js +++ b/core/utils/auth-guard.js @@ -157,6 +157,12 @@ export async function ensureEntry(store, forceValidate = false) { export async function handleTokenExpired(store) { clearSession(store) + // 工作台会话 token 失效:一并清除工作台登录态,避免登录页 onShow 检测到残留 workbenchToken 后自动重进打包模式造成死循环 + try { + uni.removeStorageSync('workbenchToken') + uni.removeStorageSync('workbenchInfo') + uni.removeStorageSync('workbenchOperator') + } catch (e) {} const currentRoute = getCurrentRoute() if (!isLoginRoute(currentRoute)) { await goLogin() diff --git a/core/utils/broadcast.js b/core/utils/broadcast.js index 6124004..16e3baf 100644 --- a/core/utils/broadcast.js +++ b/core/utils/broadcast.js @@ -114,6 +114,9 @@ export default class BroadcastManager { const dataKey = this.config.dataKey || 'value'; const data = intent.getStringExtra(dataKey); + // 诊断日志:每次收到广播都打印(含 data 为空的情况),便于排查“后续扫描无反应” + console.log('[BroadcastManager] 收到广播 action=', intent.getAction(), ' dataKey=', dataKey, ' data=', data); + if (!data) { return; } diff --git a/pages/packing/packMode.vue b/pages/packing/packMode.vue index 38562d9..6eff6a5 100644 --- a/pages/packing/packMode.vue +++ b/pages/packing/packMode.vue @@ -26,18 +26,28 @@