diff --git a/sdk/init/index.js b/sdk/init/index.js index b5b66a11df1e3414c2be6d4e4ff70107a185a8ab..3bb353ca2b23b5c62e6f01b4f8ec618988d05af3 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()