From 1b3ce58528667f4f39671992518c21dc27ca5ebe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Thu, 16 Jul 2026 21:55:38 +0800
Subject: [PATCH] =?UTF-8?q?refactor(app):=20=E7=A7=BB=E9=99=A4=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E9=9A=90=E7=A7=81=E5=8D=8F=E8=AE=AE=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 删除了PrivacyModal组件及相关引用
- 移除了基于微信基础库3.16.1+的隐私协议处理逻辑
- 清理了与privacyManager相关的调用代码
- 简化了应用初始化逻辑,去除不再使用的隐私授权监听
- 优化了代码结构,减少冗余依赖和模块导入
---
src/app.tsx | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/src/app.tsx b/src/app.tsx
index 9ff51e5..2cdb97e 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -7,8 +7,6 @@ import AppContext from './contexts/AppContext'
import { UserProvider } from './contexts/UserContext'
import { CartProvider } from './contexts/CartContext'
import ErrorBoundary from './components/ErrorBoundary'
-import PrivacyModal from './components/PrivacyModal'
-import { privacyManager } from './utils/privacy'
import './app.scss'
type AppProps = {
@@ -24,24 +22,6 @@ function App(props: AppProps) {
if (savedTheme === 'light' || savedTheme === 'dark') {
setTheme(savedTheme)
}
-
- // 微信隐私协议(基础库 3.16.1+ 强制)
- // getPhoneNumber 等敏感能力必须由用户点击 agreePrivacyAuthorization 按钮授权。
- const wxAny: any = Taro
- if (typeof wxAny.getPrivacySetting === 'function') {
- wxAny.getPrivacySetting({
- success: (res: any) => {
- if (res?.privacyContractName) {
- privacyManager.setPrivacyContractName(res.privacyContractName)
- }
- },
- })
- }
- if (typeof wxAny.onNeedPrivacyAuthorization === 'function') {
- wxAny.onNeedPrivacyAuthorization((resolve: any) => {
- privacyManager.show(resolve)
- })
- }
})
useDidShow(() => {})
@@ -65,7 +45,6 @@ function App(props: AppProps) {
{props.children}
-