原創聲明:本文為作者原創,未經允許不得轉載,經授權轉載需注明作者和出處
我用小程有獲得WIFI信息為么要啟用手機的位置信息?還要只能一次取值,重新終止小程序后,才能獲得新值。
getConnectedWifi:function(){
var that = this
that.stopWifi();
that.startWifi();
wx.getConnectedWifi({
success: function(res){
console.log(res);
that.setData({ message2: res.wifi.SSID});
that.setData({ message3: res.wifi.signalStrength});
},
fail:function(err){
console.log(err);
that.setData({ message2: err.errCode}); //‘失敗’’失敗’
}
})
},