小程序
小游戏
企业微信
微信支付
扫描小程序码分享
API wx. connectWifi
基础库: 2.15.0
微信号:haidong920me 华为手机
打开小程序提示连接wifi,点击链接 ,然后闪退
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,提供下复现的视频或者代码
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你好,提供下复现的视频或者代码
var _this = this;
wx.connectWifi({
SSID: app.globalData.SSID,
BSSID: app.globalData.BSSID,
password: app.globalData.PASSWORD,
success: function (res) {
if (_this.platform == 'ios') {
wx.onWifiConnected(function (res) {
console.log(res.wifi)
if (res.wifi.SSID == app.globalData.SSID) {
wx.showToast({
title: 'wifi连接成功',
})
}else{
wx.showToast({
title: '请重新进入小程序',
})
}
})
} else {
wx.showToast({
title: 'wifi连接成功',
})
}
},
fail: function (res) {
_this.setData({
endError: res.errMsg
});
}
})
},