canIUse是false,但会执行success方法代码
// 代码
1 wx.getSystemInfo({ 2 success(res) { 3 console.log(res) 4 } 5 }) 6 console.log(wx.canIUse( "getSetting.success" ), wx.canIUse( "authorize.success" )) 7 wx.getSetting({ 8 success(res) { 9 if (!res.authSetting[ 'scope.writePhotosAlbum' ]) { 10 wx.authorize({ 11 scope: 'scope.writePhotosAlbum' , 12 success() { 13 console.log( 'success' ) 14 } 15 }) 16 } 17 } 18 }) |
// log信息
// 代码行1
true false //代码行6
success //代码行13
canIUse是false,但是可以授权成功