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 @@