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
(尽量先备份再操作)