wx.openSetting({}) 在catch中无效?
发布于 4 年前 作者 jingzou 1616 次浏览 来自 官方Issues
// bindtap 事件
getCurrentLocation(){
    wx.getSetting({
      success:(res)=>{
        if (!res.authSetting['scope.userLocation']) {
          wx.authorize({
            scope:'scope.userLocation',
            success:()=>{
              this.getLocation()
            },
            fail:(e)=>{
              console.log("authorize e",e)
              wx.openSetting() //如果拒绝了权限申请,这里无法唤起设置面板
            }
          })
        }else{
          this.getLocation()
        }
      }
    })
    
  },
回到顶部