From d4f6266fcc006228d0ea58818f6d647843c3a309 Mon Sep 17 00:00:00 2001 From: duxingchen Date: Fri, 7 Aug 2026 17:05:00 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20scan=E9=A1=B5=E7=BD=AE=E9=A1=B6?= =?UTF-8?q?=E6=B6=88=E9=99=A4=E7=99=BB=E5=BD=95=E9=A1=B5=E9=97=AA=E7=83=81?= =?UTF-8?q?=20=E2=80=94=20=E5=B7=B2=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=9B=B6=E8=B7=B3=E8=BD=AC=E7=9B=B4=E6=8E=A5=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- track-uniapp/src/App.vue | 9 +++------ track-uniapp/src/pages.json | 14 +++++++------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/track-uniapp/src/App.vue b/track-uniapp/src/App.vue index aa12fb8..6746c56 100644 --- a/track-uniapp/src/App.vue +++ b/track-uniapp/src/App.vue @@ -5,17 +5,14 @@ export default { onLaunch() { console.log("生产流转 T1.0.2 启动"); - // 🚦 统一路由守卫:根据登录态重定向到正确页面 + // 🚦 路由守卫:首页已是 scan,未登录才跳登录页(零闪烁) const token = uni.getStorageSync("access_token") || uni.getStorageSync("refresh_token"); const user = uni.getStorageSync("user"); - if (token && user) { - // 已登录 → 直接进扫码干活页 - uni.reLaunch({ url: "/pages/scan/index" }); - } else { - // 未登录 → 去登录页 + if (!token || !user) { uni.reLaunch({ url: "/pages/login/login" }); } + // 已登录 → 原地渲染 scan 页,不需任何跳转 // 🚀 OTA 热更新检测(仅 App 端生效) // #ifdef APP-PLUS diff --git a/track-uniapp/src/pages.json b/track-uniapp/src/pages.json index 07d4f7c..2a5198b 100644 --- a/track-uniapp/src/pages.json +++ b/track-uniapp/src/pages.json @@ -1,12 +1,5 @@ { "pages": [ - { - "path": "pages/login/login", - "style": { - "navigationBarTitleText": "登录", - "navigationStyle": "custom" - } - }, { "path": "pages/scan/index", "style": { @@ -15,6 +8,13 @@ "navigationBarTextStyle": "white" } }, + { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "登录", + "navigationStyle": "custom" + } + }, { "path": "pages/scan/records", "style": {