You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1019 B
44 lines
1019 B
// pages/student_info/student_info.js
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
studentId : '',
|
|
name : '',
|
|
callCount : '',
|
|
score : ''
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
const that = this;
|
|
console.log(wx.getStorageSync('token'));
|
|
wx.request({
|
|
url: 'http://10.133.15.50:8888/student/courseInfo?courseId=' + wx.getStorageSync('courseId'),
|
|
method: 'GET',
|
|
header: {
|
|
'student_token': wx.getStorageSync('token') // 携带token
|
|
},
|
|
data: {
|
|
},
|
|
success: function(res) {
|
|
if (res.statusCode === 200) {
|
|
console.log(res.data.data);
|
|
that.setData({
|
|
studentId : res.data.data.studentId,
|
|
name : res.data.data.name,
|
|
callCount : res.data.data.callCount,
|
|
score : res.data.data.score
|
|
});
|
|
}
|
|
},
|
|
fail: function(error) {
|
|
console.error('请求失败:', error);
|
|
}
|
|
});
|
|
},
|
|
}) |