fix(h5): 修复 WebView 顶栏 logo 与内容重叠
embed 模式 header 改文档流、移除负 margin;持久化 sbh 并在路由中保留,避免胶囊区与档案条重叠。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -50,8 +50,20 @@ const router = createRouter({
|
||||
})
|
||||
|
||||
router.beforeEach((to) => {
|
||||
if (!isMpEmbed() || to.query.mp === '1') return true
|
||||
return { path: to.path, query: { ...to.query, mp: '1' }, hash: to.hash, replace: true }
|
||||
if (!isMpEmbed()) return true
|
||||
const q = { ...to.query }
|
||||
let changed = false
|
||||
if (q.mp !== '1') {
|
||||
q.mp = '1'
|
||||
changed = true
|
||||
}
|
||||
const storedSbh = sessionStorage.getItem('yxg_sbh')
|
||||
if (storedSbh && q.sbh !== storedSbh) {
|
||||
q.sbh = storedSbh
|
||||
changed = true
|
||||
}
|
||||
if (!changed) return true
|
||||
return { path: to.path, query: q, hash: to.hash, replace: true }
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user