Setting data field "result" to undefined is invalid
程序员文章站
2024-03-13 23:30:58
...
当时是因为不熟悉Promise语法敲错了变量名
export const request = (params) => {
return new Promise((resolve, reject) => {
wx.request({
...params,
success: (result) => {
resolve(request);
},
fail: (err) => {
reject(err);
}
});
})
}
改成
export const request = (params) => {
return new Promise((resolve, reject) => {
wx.request({
...params,
success: (result) => {
resolve(result);
},
fail: (err) => {
reject(err);
}
});
})
}