feat0806: 只在进入微赞直播间和退出时清理微赞缓存
| | |
| | | return; |
| | | } |
| | | |
| | | const webviewUrl = `/pages/webview/webview?url=${encodeURIComponent(targetUrl)}&title=${encodeURIComponent('微赞直播')}`; |
| | | const webviewUrl = `/pages/webview/webview?url=${encodeURIComponent(targetUrl)}&title=${encodeURIComponent('微赞直播')}&clearCache=1`; |
| | | console.log('[goWeiZanLive] 准备跳转 WebView:', webviewUrl); |
| | | |
| | | uni.navigateTo({ |
| | |
| | | onLoad((options) => { |
| | | const resolvedUrl = decodeQueryValue(options?.url) |
| | | const resolvedTitle = decodeQueryValue(options?.title) |
| | | // 仅在入口显式要求时清理(如进入微赞直播间);直播订单、直播统计等无需清理 |
| | | const shouldClearCache = String(options?.clearCache || '') === '1' |
| | | |
| | | // #ifdef APP-PLUS |
| | | // 加载 URL 前先清理所有 webview 的缓存、Cookie 和存储,避免上次登录态残留 |
| | | if (shouldClearCache) { |
| | | clearWebViewData() |
| | | console.log('[WebView] 进入前缓存已清理,URL:', resolvedUrl) |
| | | } |
| | | // #endif |
| | | |
| | | webViewUrl.value = resolvedUrl |