feat(h5): 小程序 embed 模式与全站 ICP 备案页脚

H5 支持 ?mp=1 嵌入微信 WebView;user-h5/admin-h5 底部展示蜀ICP备2025140386号-2 并链至工信部;补充小程序+H5 部署说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-25 00:41:14 +08:00
co-authored by Cursor
parent d33a25a663
commit 8d856fb56c
14 changed files with 498 additions and 7 deletions
+24
View File
@@ -0,0 +1,24 @@
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import { initMpEmbed, isMpEmbed } from './mpEmbed'
describe('mpEmbed', () => {
beforeEach(() => {
sessionStorage.clear()
window.history.replaceState({}, '', '/psy/')
})
afterEach(() => {
sessionStorage.clear()
})
it('persists embed flag from ?mp=1', () => {
window.history.replaceState({}, '', '/psy/?mp=1')
initMpEmbed()
expect(isMpEmbed()).toBe(true)
})
it('returns false without mp query', () => {
initMpEmbed()
expect(isMpEmbed()).toBe(false)
})
})