const app = getApp() Component({ /** * 组件的属性列表 */ properties: { userList: { type: Array } }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { loginAccount(e) { //全局储存 wx.setStorageSync('token', this.data.userList[e.currentTarget.dataset.index].token) wx.reLaunch({ url: '/pages/tabbarPage/Home/index' }) } } })