reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught TypeError: Cannot destructure property 'http' of 'uni.$u' as it is undefined
8***@qq.com
- 发布:2022-10-16 16:05
- 更新:2024-04-12 18:20
- 阅读:1827
遇到了相同的问题,下面的代码App端调试报错(TypeError: Cannot read property 'http' of undefined),其他端正常...
const http = uni.$uv.http
export function userinfoApi(params = {}) {
return http.get("/user/info", {
params,
custom: {
auth: true,
loading: false,
},
});
}
经过调试发现是这段代码的问题
const http = uni.$uv.http
改成下面这种写法就可以解决
export function userinfoApi(params = {}) {
return uni.$uv.http.get("/user/info", {
params,
custom: {
auth: true,
loading: false,
},
});
}
神奇的世界...
swallowMuzi
请问一下你解决了吗
2023-03-25 11:54
1***@139.com
回复 swallowMuzi: 解决了吗
2023-06-20 16:29