7***@qq.com
7***@qq.com
  • 发布:2025-03-13 10:32
  • 更新:2025-03-13 13:49
  • 阅读:19

【报Bug】wx.getSystemInfo is deprecated. wx.getSystemInfoSync is deprecated.

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 10

HBuilderX类型: 正式

HBuilderX版本号: 4.56

第三方开发者工具版本号: 稳定版 Stable Build(1.06.2412050)

基础库版本号: 3.7.10

项目创建方式: HBuilderX

操作步骤:

 export default {  
    onLaunch: function() {  
      uni.getSystemInfo({  
        success: function(e) {}  
      })  
   }  
 } 

预期结果:

希望能编译成微信小程序最新的API

实际结果:

微信小程序开发者工具会警告:

wx.getSystemInfo is deprecated.Please use wx.getSystemSetting/wx.getAppAuthorizeSetting/wx.getDeviceInfo/wx.getWindowInfo/wx.getAppBaseInfo instead.

wx.getSystemInfoSync is deprecated.Please use wx.getSystemSetting/wx.getAppAuthorizeSetting/wx.getDeviceInfo/wx.getWindowInfo/wx.getAppBaseInfo instead.

bug描述:

使用uni.getSystemInfo 或 uni.getSystemInfoSync 会报错。如下。

2025-03-13 10:32 负责人:无 分享
已邀请:
爱豆豆

爱豆豆 - 办法总比困难多

不都提示出来了嘛?停止维护了啊 不是uniapp的问题
请使用 wx.getSystemSetting、wx.getAppAuthorizeSetting、wx.getDeviceInfo、wx.getWindowInfo、wx.getAppBaseInfo 代替
参考文档:https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoSync.html

要回复问题请先登录注册