微信小程序开发(九)获取手机连接的wifi信息

时间:2019-10-14 19:58:33   收藏:0   阅读:462
// succ.wxml
<view>WIFI ssid:{{wifissid}}</view>
<view>WIFI bssid:{{wifiBssid}}</view>

// succ.js
var app = getApp()
Page({
  data: {
    wifissid: ‘‘,  // WIFI ssid
    wifiBssid: ‘‘  // WIFI bssid
  },
  onLoad: function (e) {  // 获取参数
    var that = this;
    wx.getConnectedWifi({
      success: function(e){
        that.setData({
          wifissid: e.wifi.SSID,
          wifiBssid: e.wifi.BSSID
        })
      }
    })
  }
})

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!