diff --git a/.tmp/peripheral-qr-88100001.png b/.tmp/peripheral-qr-88100001.png deleted file mode 100644 index bd99cb3..0000000 Binary files a/.tmp/peripheral-qr-88100001.png and /dev/null differ diff --git a/frontend/RANKING_API_SPECIFICATION.md b/docs/RANKING_API_SPECIFICATION.md similarity index 100% rename from frontend/RANKING_API_SPECIFICATION.md rename to docs/RANKING_API_SPECIFICATION.md diff --git a/frontend/App.vue b/frontend/App.vue index 7d137d2..1e694bd 100644 --- a/frontend/App.vue +++ b/frontend/App.vue @@ -25,9 +25,6 @@ import { onDeepLinkTo } from '@/utils/scanLaunch.js' - import { - clearAllSandboxTmpFiles - } from '@/utils/ioPath.js' // 记录上次隐藏时间的 storage key const HIDE_TIME_KEY = "app_last_hide_time"; @@ -158,16 +155,10 @@ console.warn('[preload] init failed:', e.message) } - // ★ 启动清理:清掉旧版本产生的 doc/<业务>/tmp/ 历史残留(升级新包后第一次启动生效) - // fire-and-forget,不阻塞 onLaunch 其它初始化 - // #ifdef APP-PLUS - clearAllSandboxTmpFiles().catch((e) => { - console.warn('[App] clearAllSandboxTmpFiles failed:', e?.message) - }) - // #endif - - // ★ 新增:清理历史下载的更新包(见 upgrade-popup.vue:_downloads/upgrade_*.wgt 累积) - this.cleanupUpgradePackages(); + // 2026-07-31 决议:App.vue 不再做任何启动清理。 + // - 老版本 doc/<业务>/tmp/ 历史残留:用户进入"存储空间 → 临时文件"分类手动清 + // - _downloads/upgrade_*.{wgt,apk,ipa}:用户进入"存储空间 → 其他业务缓存"分类手动清 + // 保留:upgrade-popup#cleanupAfterInstall(安装成功后自动清) this.setPermissions(); @@ -284,62 +275,6 @@ const globalSocket = getGlobalSocket(); globalSocket.closeAll(); }, - /** - * 清理历史下载的更新包(_downloads/upgrade_*.{wgt,apk,ipa}) - * - uni-upgrade-center-app 插件的 plus.downloader 默认把包放在 _downloads/upgrade_${ts}.{wgt|apk} - * - 升级弹窗关闭/下载中断/未点击安装时,这些临时包不会自动清理,会持续累积 - * - 已通过 saveFile() 持久化的包在 _doc/ 目录下(路径不同),由升级弹窗 checkLocalStoragePackage 控制 - * - * 各平台实际会产生哪些文件: - * - Android 整包更新 → .apk - * - Android wgt 热更新 → .wgt - * - iOS wgt 热更新 → .wgt (iOS 整包 (ipa) 走 App Store,不下载本地) - * - ipa 加入正则仅作防御:防止后端配置错误/silent update 误推到本地 - * - * 启动期清理一次即可(App 正常运行期间只要不离 _downloads/ 目录就不会有新遗留) - * 仅 APP-PLUS 有效 - */ - cleanupUpgradePackages() { - // #ifdef APP-PLUS - try { - const dirUrl = plus.io.convertLocalFileSystemURL("_downloads/"); - plus.io.resolveLocalFileSystemURL( - dirUrl, - (dirEntry) => { - const reader = dirEntry.createReader(); - reader.readEntries( - (entries) => { - entries.forEach((entry) => { - // 命名规则:见 uni-upgrade-center-app/pages/upgrade-popup.vue:_downloads/upgrade_${Date.now()}.{wgt|apk} - // ipa 在标准流程不会出现,但加入正则作防御 - if (!/^upgrade_\d+\.(wgt|apk|ipa)$/i.test(entry.name)) return; - entry.remove( - () => {}, - (e) => - console.warn( - "[UPGRADE-CLEANUP] 删包失败:", - entry.fullPath, - e?.message, - ), - ); - }); - }, - (e) => - console.warn( - "[UPGRADE-CLEANUP] 枚举 _downloads 失败:", - e?.message, - ), - ); - }, - () => { - // _downloads 目录不存在是正常情况(从未下过更新包),静默忽略 - }, - ); - } catch (e) { - console.warn("[UPGRADE-CLEANUP] 初始化失败:", e?.message); - } - // #endif - }, /** * 处理"从后台切回前台"事件 * 通过 storage 中的上次隐藏时间判断本次 onShow 是否由后台返回触发 @@ -644,17 +579,25 @@ font-display: swap; } - /* 引入 ZaoZiGongFangJianHei-1 字体 */ + /* 引入 JDLTYuanTiJian(经典圆体简)字体 + * + * 原 OSS 上的 JDLTYuanTiJian.ttf 存在 7 处 OpenType 规范违规(表未 4 字节对齐、 + * cmap format4 子表 length 少 2 字节、loca 缺哨兵、glyf 尾部混入填充垃圾等), + * 被 Android WebView 的 OTS 校验器拒绝解码,控制台报 + * "OTS parsing error: cmap: misaligned table",字体静默回退到系统字体。 + * + * 已用 frontend/scripts/fix-broken-ttf.py 修复并转为 woff2(3.57MB -> 2.01MB), + * 产物通过 ots-sanitize 0 error / 0 warning 校验,字形轮廓与原字体完全一致。 + * 改为本地加载:免去首屏网络下载,且不再依赖 OSS。 + */ @font-face { font-family: "JDLTYuanTiJian"; - src: url("/static/fonts/JDLTYuanTiJian.ttf") format("truetype"); + src: url("/static/fonts/JDLTYuanTiJian.woff2") format("woff2"); font-weight: normal; font-style: normal; font-display: swap; } - /* 圆体 JDLTYuanTiJian.ttf 在部分 Android WebView 上报 OTS/cmap 解析失败,暂不 @font-face 加载,避免控制台告警与渲染异常 */ - /* 全局字体设置 */ body { font-family: diff --git a/frontend/index.html b/frontend/index.html index 103cd12..e6972cf 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -23,7 +23,7 @@