// 获取全局应用程序实例对象 const app = getApp(); // 创建页面实例对象 Page({ onLoad: function () { var userstr=wx.getStorageSync('userstr') console.log(userstr); let user = JSON.parse(userstr); console.log(user); var that = this that.setData({ userid: user.userid, username: user.username, userauthor: user.userpassword }) } })