Loading... ## 引言 今天在做uniapp开发的过程中,遇到了这个问题,,  出现报错信息为: `[memory-leak] triggerOnEvent called on a deprecated instance` 一头懵逼 ## 解决方案 ```js uni.request({ url: "目标地址", dataType: "json", responseType: "json", method: "POST", data: 数据对象, header: { "Content-Type": "application/json", }, success(resp) { // 响应处理回调函数 }, fail(e) { console.log(e); } }) ``` 主要原因就是其中有这个 `responseType: "json"` 去掉就可以正常返回了。 就是这个样子  ```js uni.request({ url: "目标地址", dataType: "json", method: "POST", data: 数据对象, header: { "Content-Type": "application/json", }, success(resp) { // 响应处理回调函数 }, fail(e) { console.log(e); } }) ``` 借鉴帖子: > [https://developers.weixin.qq.com/community/develop/doc/0006a8fb100f40290c910a8086b800](https://developers.weixin.qq.com/community/develop/doc/0006a8fb100f40290c910a8086b800) 注意: 这里的`dataType`代表着请求参数是json格式,文档中写的意思是: > 如果设为 json,会对返回的数据进行一次 JSON.parse,非 json 不会进行 JSON.parse 欢迎关注拓行公众号,分享各种技术博客文章拓行——奋勇进取,开拓未来,砥砺前行 最后修改:2025 年 01 月 18 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果您对各种技术博客文章感兴趣,欢迎关注拓行公众号,分享各种专业技术知识~