当前位置:编程学习 > uniapp >>

uniapp报错wx-getSystemInfo is deprecated

uniapp报错wx-getSystemInfo is deprecated. Please usewx.getSystemSetting/wx.getAppAuthorizeSetting/wx.


bug描述:
wx-getSystemInfo is deprecated. Please use
wx.getSystemSetting/wx.getAppAuthorizeSetting/wx.getDeviceInfo/wx.getWindowInfo/wx.getA
ppBaseInfo instead.



出错原因是:官网不在维护wx.getSystemInfoSync 接口

解决方案:
直接按提示使用:wx.getSystemSetting/wx.getAppAuthorizeSetting/wx.getDeviceInfo/wx.getWindowInfo/wx.getA
ppBaseInfo这几个接口其一就好啦

官网解决方案同上提示:Object wx.getSystemInfoSync() | 微信开放文档

我的是uniapp项目,然后我直接全局用getSystemSetting替换getSystemInfoSync 

(尽量先备份再操作)

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,