收藏
回答

开发工具调试wx.requirePrivacyAuthorize报错后才能弹出官方隐私弹窗?

Page({
  onLoad(){
        // 取消该部分注释后,开发工具调试无报错,但不能弹出官方隐私弹窗
     // if (wx.onNeedPrivacyAuthorization) {
    //   wx.onNeedPrivacyAuthorization(resolve => {
    //     // 需要用户同意隐私授权时
    //     // 弹出开发者自定义的隐私授权弹窗
    //     console.log(123);
    //     this.setData({
    //       showPrivacy: true
    //     })
    //     this.resolvePrivacyAuthorization = resolve
    //     console.log(resolve);
    //   })
    // }
    wx.requirePrivacyAuthorize({
      success(res) => {
        // 用户同意授权继续小程序逻辑
        wx.showToast({
          title'完成授权',
        })
      },
      fail(e) => {console.log(e);}, // 用户拒绝授权
      complete() => {}
    });
  },
})


[system] WeChatLib: 3.0.2 (2023.12.27 23:35:33)
开发工具调试报错如下:
VM79560:1 invalid init scl: init before tap Error: invalid init scl: init before tap
    at Object.H [as initScl] (<anonymous>:1:260573)
    at Object.<anonymous> (http://127.0.0.1:42960/appservice/__dev__/WAServiceMainContext.js?t=wechat&s=1705554586761&v=3.0.2:1:2044301)
    at QN (http://127.0.0.1:42960/appservice/__dev__/WAServiceMainContext.js?t=wechat&s=1705554586761&v=3.0.2:1:967869)
    at http://127.0.0.1:42960/appservice/__dev__/WAServiceMainContext.js?t=wechat&s=1705554586761&v=3.0.2:1:635637
    at new Promise (<anonymous>)
    at http://127.0.0.1:42960/appservice/__dev__/WAServiceMainContext.js?t=wechat&s=1705554586761&v=3.0.2:1:635616
    at tB (http://127.0.0.1:42960/appservice/__dev__/WAServiceMainContext.js?t=wechat&s=1705554586761&v=3.0.2:1:968623)
    at http://127.0.0.1:42960/appservice/__dev__/WAServiceMainContext.js?t=wechat&s=1705554586761&v=3.0.2:1:1232131
    at Generator.next (<anonymous>)
    at n (http://127.0.0.1:42960/appservice/__dev__/WAServiceMainContext.js?t=wechat&s=1705554586761&v=3.0.2:1:3663)(env: Windows,mp,1.06.2310080; lib: 3.0.2)

回答关注问题邀请回答
收藏

1 个回答

  • 小程序运营专员-yuan
    小程序运营专员-yuan
    01-22

    你好,已知问题修复中!可以尝试将工具上切到最新版本基础库

    01-22
    有用
    回复
登录 后发表内容