wx.request({
url: apiUrl,
header: {
'content-type': 'application/x-www-form-urlencoded',
'Cookie': 'PHPSESSID=' + wx.getStorageSync('pingshifen_PHPSESSID')
},
data: {
method: 'pingshifen.student.bind',
name: this.data.name,
tel: this.data.tel,
school: this.data.school,
num: this.data.num,
enter_year: this.data.year[this.data.yearIndex],
user_type: this.data.role_list.selectedId,
},
method: 'POST',
success: res => {
wx.hideLoading()
if (res.data.success == true) {
wx.showToast({
title: res.data.message,
icon:'success',
})
wx.setStorageSync('pingshifen_user_type', '1')
wx.reLaunch({
url: '/pages/index/index',
})
} else {
wx.showToast({
title: res.data.message,
icon: 'none'
})
}
},
fail: res => {
wx.hideLoading()
wx.showToast({
title: '绑定失败',
icon:'none'
})
},
conplete: res => {
wx.hideLoading()
}
})
}
你好,请按照错误提示修改,title需为string类型