可以跳转啊,你的跳转url错误,可以’…/minePages/myIntro/myIntro’,或者‘/pages/minePages/myIntro/myIntro’,但是有时候/pages/这种跳转会报错,不知道为什么,所以我用…/这种。话说,你为什么不直接一层,怎么pages里面还套了一层minePages,没试过这种再包一层
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync(‘key’) || []
logs.unshift(Date.now())
wx.setStorage({
key: “logs”,
data: logs
})
// 登录
wx.login({
success: res => {
wx.request({
url: util.Apis +’***’,
data: {
code: res.code,
},
header: {
‘content-type’: ‘application/x-www-form-urlencoded’ // 默认值
},
method: ‘POST’,
success: function (res) {
wx.setStorage({
key: “openidLocal”,
data: res.data.data.openid
})
wx.setStorage({
key: “userId”,
data:‘11111111111a’,
})
if (res.data.state ==‘success’){//已经绑定过账号
wx.setStorage({
key: “userId”,
data: res.data.user,
})
}else{
wx.navigateTo({
url: “…/register/register”
})
}
}
})
}
})
},
’
wx.getStorage(
{
key: ‘userInro’,
success: function (res) {
// that.setData({
// userId: res.data.userId,
// organizationId: res.data.organizationId,
// windowHeight: wx.getStorageSync(‘windowHeight’),
// })
// if (!that.data.isGetdata) {
// that.getCategory(that.data.currentIndex, that.data.currentPage)
// }
console.log(‘获取到了用户已经登陆的信息’)
that.globalData.isLogin = 1
},
fail: function (res) {
wx.switchTab({
url: ‘pages/minePages/myIntro/myIntro’
})
that.globalData.isLogin = 0
console.log(‘没有登陆’)
},
complete: function (res) {
console.log(res)
}
})