refactor(app): 移除微信隐私协议相关代码
- 删除了PrivacyModal组件及相关引用 - 移除了基于微信基础库3.16.1+的隐私协议处理逻辑 - 清理了与privacyManager相关的调用代码 - 简化了应用初始化逻辑,去除不再使用的隐私授权监听 - 优化了代码结构,减少冗余依赖和模块导入
This commit is contained in:
21
src/app.tsx
21
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) {
|
||||
<View className={theme === 'dark' ? 'dark' : ''}>
|
||||
{props.children}
|
||||
</View>
|
||||
<PrivacyModal />
|
||||
</ErrorBoundary>
|
||||
</ConfigProvider>
|
||||
</CartProvider>
|
||||
|
||||
Reference in New Issue
Block a user