[图片] ------------------------------------------------------------------------- 降低微信开发者工具版本后,该问题消失
最新版微信开发者工具:redirectTo:fail timeout ?鉴权组件 auth.js import { ComponentWithStore } from 'mobx-miniprogram-bindings' import { userStore } from '@/stores/userStore.js' ComponentWithStore({ data: { isLogin: false }, storeBindings: { store: userStore, fields: ['token'] }, lifetimes: { attached() { // 当组件被渲染时会执行的生命周期 const isLogin = !!this.data.token if (!isLogin) { // 获取当前全部被打开的页面实例 const pageStack = getCurrentPages() // 最后一个页面 const lastPage = pageStack[pageStack.length - 1] // 重定向到登录页面 wx.redirectTo({ url: `/pages/login/login/index`, success: (res) => { console.log(res) }, fail: (err) => { console.log(err) } }) } } } }) <auth> xxxx </auth>
01-24