微信小程序中獲取用戶權限授權情況 wx.getSetting 的 success 回調結果很奇怪:
wx.getSetting({
success: function(e) {
console.log(e.authSetting)
}
})
因爲我之前已經授權了地理位置的獲取權限,所以結果是
{scope.userLocation: true}
但是這種鍵的方式我是第一次看到,通過
e.authSetting.scope.userLocation
這樣是取不到值的,因爲鍵是個字符串,所以可以通過數組的方式取:
e.authSetting["scope.userLocation"]