小程序
小游戏
企业微信
微信支付
扫描小程序码分享
为什么部分手机wifi连接返回的结果与实际连接状态不一样?
返回结果连接成功,但是实际连接的wifi不是选择的wifi
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
connectWifi() {
// uni.showLoading({
// title: '连接中'
// })
let that = this
let object = {
SSID: this.SSID,
// BSSID: "08:9b:4b:97:44:ad",
password: this.password,
partialInfo: true,
}
if(this.bssid){
object = {
BSSID: this.bssid,
object = Object.assign(object, {
success: function(n) {
console.log(n, '>>>>>>>>>><<<<<<<')
// "ios" == t.SystemInfo.platform && setTimeout(function() {
// if (!t.is_connect) return t.is_linked = !1, t.is_loading = !1, console.log("连接超时,无效"),
// t.$refs.uToast.show({
// message: "连接失败,自动复制密码",
// complete: function() {
// t.onCopyPssword();
// }
// }), !1;
// }, 1e4);
if (n.errCode == 0) {
//连接成功
that.linkWifi()
} else {
uni.showModal({
title: '提示',
content: that.getErrCode(n.errCode),
showCancel: false,
success: function(res) {
uni.navigateBack()
});
},
fail: function(n) {
console.log(n, '>>>>>>>>>>')
let content = n.errMsg;
if (n.errCode) {
content = that.getErrCode(n.errCode)
that.connectWifiTwo()
// uni.showModal({
// title: '提示',
// content: content,
// showCancel: false,
// success: function(res) {
// uni.navigateBack()
// });
})
wx.connectWifi(
object
);
connectWifiTwo() {
forceNewApi:true,
maunal:true
content: content,
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
// uni.showLoading({
// title: '连接中'
// })
let that = this
let object = {
SSID: this.SSID,
// BSSID: "08:9b:4b:97:44:ad",
password: this.password,
partialInfo: true,
}
if(this.bssid){
object = {
SSID: this.SSID,
BSSID: this.bssid,
password: this.password,
partialInfo: true,
}
}
object = Object.assign(object, {
success: function(n) {
console.log(n, '>>>>>>>>>><<<<<<<')
// "ios" == t.SystemInfo.platform && setTimeout(function() {
// if (!t.is_connect) return t.is_linked = !1, t.is_loading = !1, console.log("连接超时,无效"),
// t.$refs.uToast.show({
// message: "连接失败,自动复制密码",
// complete: function() {
// t.onCopyPssword();
// }
// }), !1;
// }, 1e4);
if (n.errCode == 0) {
//连接成功
that.linkWifi()
} else {
uni.showModal({
title: '提示',
content: that.getErrCode(n.errCode),
showCancel: false,
success: function(res) {
uni.navigateBack()
}
});
}
},
fail: function(n) {
console.log(n, '>>>>>>>>>>')
let content = n.errMsg;
if (n.errCode) {
content = that.getErrCode(n.errCode)
}
that.connectWifiTwo()
// uni.showModal({
// title: '提示',
// content: content,
// showCancel: false,
// success: function(res) {
// uni.navigateBack()
// }
// });
}
})
wx.connectWifi(
object
);
},
connectWifiTwo() {
// uni.showLoading({
// title: '连接中'
// })
let that = this
let object = {
SSID: this.SSID,
// BSSID: "08:9b:4b:97:44:ad",
password: this.password,
partialInfo: true,
forceNewApi:true,
maunal:true
}
if(this.bssid){
object = {
SSID: this.SSID,
BSSID: this.bssid,
password: this.password,
partialInfo: true,
forceNewApi:true,
maunal:true
}
}
object = Object.assign(object, {
success: function(n) {
console.log(n, '>>>>>>>>>><<<<<<<')
// "ios" == t.SystemInfo.platform && setTimeout(function() {
// if (!t.is_connect) return t.is_linked = !1, t.is_loading = !1, console.log("连接超时,无效"),
// t.$refs.uToast.show({
// message: "连接失败,自动复制密码",
// complete: function() {
// t.onCopyPssword();
// }
// }), !1;
// }, 1e4);
if (n.errCode == 0) {
//连接成功
that.linkWifi()
} else {
uni.showModal({
title: '提示',
content: that.getErrCode(n.errCode),
showCancel: false,
success: function(res) {
uni.navigateBack()
}
});
}
},
fail: function(n) {
console.log(n, '>>>>>>>>>>')
let content = n.errMsg;
if (n.errCode) {
content = that.getErrCode(n.errCode)
}
uni.showModal({
title: '提示',
content: content,
showCancel: false,
success: function(res) {
uni.navigateBack()
}
});
}
})
wx.connectWifi(
object
);
},
connectWifi() {
// uni.showLoading({
// title: '连接中'
// })
let that = this
let object = {
SSID: this.SSID,
// BSSID: "08:9b:4b:97:44:ad",
password: this.password,
partialInfo: true,
}
if(this.bssid){
object = {
SSID: this.SSID,
BSSID: this.bssid,
password: this.password,
partialInfo: true,
}
}
object = Object.assign(object, {
success: function(n) {
console.log(n, '>>>>>>>>>><<<<<<<')
// "ios" == t.SystemInfo.platform && setTimeout(function() {
// if (!t.is_connect) return t.is_linked = !1, t.is_loading = !1, console.log("连接超时,无效"),
// t.$refs.uToast.show({
// message: "连接失败,自动复制密码",
// complete: function() {
// t.onCopyPssword();
// }
// }), !1;
// }, 1e4);
if (n.errCode == 0) {
//连接成功
that.linkWifi()
} else {
uni.showModal({
title: '提示',
content: that.getErrCode(n.errCode),
showCancel: false,
success: function(res) {
uni.navigateBack()
}
});
}
},
fail: function(n) {
console.log(n, '>>>>>>>>>>')
let content = n.errMsg;
if (n.errCode) {
content = that.getErrCode(n.errCode)
}
that.connectWifiTwo()
// uni.showModal({
// title: '提示',
// content: content,
// showCancel: false,
// success: function(res) {
// uni.navigateBack()
// }
// });
}
})
wx.connectWifi(
object
);
},
connectWifiTwo() {
// uni.showLoading({
// title: '连接中'
// })
let that = this
let object = {
SSID: this.SSID,
// BSSID: "08:9b:4b:97:44:ad",
password: this.password,
partialInfo: true,
forceNewApi:true,
maunal:true
}
if(this.bssid){
object = {
SSID: this.SSID,
BSSID: this.bssid,
password: this.password,
partialInfo: true,
forceNewApi:true,
maunal:true
}
}
object = Object.assign(object, {
success: function(n) {
console.log(n, '>>>>>>>>>><<<<<<<')
// "ios" == t.SystemInfo.platform && setTimeout(function() {
// if (!t.is_connect) return t.is_linked = !1, t.is_loading = !1, console.log("连接超时,无效"),
// t.$refs.uToast.show({
// message: "连接失败,自动复制密码",
// complete: function() {
// t.onCopyPssword();
// }
// }), !1;
// }, 1e4);
if (n.errCode == 0) {
//连接成功
that.linkWifi()
} else {
uni.showModal({
title: '提示',
content: that.getErrCode(n.errCode),
showCancel: false,
success: function(res) {
uni.navigateBack()
}
});
}
},
fail: function(n) {
console.log(n, '>>>>>>>>>>')
let content = n.errMsg;
if (n.errCode) {
content = that.getErrCode(n.errCode)
}
uni.showModal({
title: '提示',
content: content,
showCancel: false,
success: function(res) {
uni.navigateBack()
}
});
}
})
wx.connectWifi(
object
);
},