// pages/student_info/student_info.js Page({ /** * 页面的初始数据 */ data: { records : [ ] }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { const that = this; console.log(wx.getStorageSync('token')); wx.request({ url: 'http://10.133.15.50:8888/student/callRecord?courseId=' + wx.getStorageSync('courseId'), method: 'POST', header: { 'student_token': wx.getStorageSync('token') // 携带token }, data: { page: '1', pageSize: '10000' }, success: function(res) { if (res.statusCode === 200) { console.log(res.data.data); that.setData({ records: res.data.data.records }); } }, fail: function(error) { console.error('请求失败:', error); } }); }, })