From 3eb19dc5aac211d9a96cd292c2f411f178360c21 Mon Sep 17 00:00:00 2001 From: DCloud_JSON Date: Mon, 17 Jun 2024 20:13:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=B9=B3=E5=8F=B0=EF=BC=8C=E4=BC=9A=E5=9C=A8?= =?UTF-8?q?=E8=BE=83=E6=97=A9=E7=9A=84=E6=97=B6=E6=9C=BA=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=20onAppActivateStateChange=E5=86=85=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E6=AD=A4=E6=97=B6currentPage=E8=BF=98=E6=9C=AA?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=AE=8C=E6=88=90=EF=BC=8C=E5=BC=95?= =?UTF-8?q?=E8=B5=B7=E7=9A=84=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/init/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/init/index.js b/sdk/init/index.js index b5b66a1..3bb353c 100644 --- a/sdk/init/index.js +++ b/sdk/init/index.js @@ -116,7 +116,7 @@ export default async function (initParam) { // 拿到当前页面的路由 const pages = getCurrentPages() const currentPage = pages[pages.length - 1] - const isLoginPage = currentPage.route.includes('uni_modules/uni-id-pages/pages/login') + const isLoginPage = currentPage?.route.includes('uni_modules/uni-id-pages/pages/login') // 第二次 activate 之后开始 检查token是否已经过期,如果已经过期则重定向至登录页面 const { tokenExpired } = uniCloud.getCurrentUserInfo() -- GitLab