feat(privacy): add url-based skip rule for H5 privacy popup
add ability to skip privacy popup when visiting specific H5 URLs directly, update PrivacyManager.show to accept skip option, add skip logic for specific form page to avoid blocking UI
This commit is contained in:
@@ -170,8 +170,20 @@ const PrivacyManager = {
|
||||
* 异步查询平台隐私状态,设置 _pendingShow 标志
|
||||
* 页面组件 mounted 时通过 consumePendingShow() 消费标志并弹窗
|
||||
* 不直接 emit 事件,避免 emit + 补偿双触发
|
||||
*
|
||||
* @param {Object} [options]
|
||||
* @param {boolean} [options.skip=false] true=本次跳过弹窗(不写 storage,下次正常访问其他页面还会弹)
|
||||
*/
|
||||
async show() {
|
||||
async show(options = {}) {
|
||||
// 主动跳过: 不查 storage、不写 storage、不弹窗
|
||||
// 用于 H5 浏览器直接访问特定 URL(子串匹配)时不让隐私弹窗挡住
|
||||
if (options && options.skip) {
|
||||
_needShow = false;
|
||||
_hasChecked = true;
|
||||
_pendingShow = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const _storageAgreed = getStorageAgreed();
|
||||
|
||||
const result = await checkPrivacy();
|
||||
|
||||
Reference in New Issue
Block a user