罗广辉
2026-04-25 31af8072b80e99d75e6c28574c1a976477bc2b83
feat: 配置微信小程序隐私协议
1 files modified
28 ■■■■ changed files
src/pages/login/index.vue 28 ●●●● patch | view | raw | blame | history
src/pages/login/index.vue
@@ -161,20 +161,20 @@
  console.log('同意隐私授权')
}
const privacyComponent =ref(null)
onShow(() =>{
  wx.getPrivacySetting({
    success: res => {
      console.log(res)
      if (!res.needAuthorization) {
        privacyComponent?.value?.closePrivacy()
        // 查询授权,针对有tab切换的页面,可以在onshow中查询隐私授权状态,判断在tab切换后是否需要关闭授权弹框
        console.log('已经同意隐私授权,不需要再次授权')
      }
    },
    fail: () => {},
    complete: () => {}
  })
})
// onShow(() =>{
//   wx.getPrivacySetting({
//     success: res => {
//       console.log(res)
//       if (!res.needAuthorization) {
//         privacyComponent?.value?.closePrivacy()
//         // 查询授权,针对有tab切换的页面,可以在onshow中查询隐私授权状态,判断在tab切换后是否需要关闭授权弹框
//         console.log('已经同意隐私授权,不需要再次授权')
//       }
//     },
//     fail: () => {},
//     complete: () => {}
//   })
// })
// #endif
</script>