fix: 尝试安卓优化

This commit is contained in:
2026-08-02 21:41:43 +08:00
parent 19627b72fb
commit c4ce8d2116
3 changed files with 112 additions and 56 deletions

View File

@@ -13,7 +13,19 @@ const isAndroidClient = (() => {
return /Android/i.test(ua) && !/CrOS/i.test(ua)
})()
const isIOSClient = (() => {
if (typeof navigator === 'undefined') return false
const ua = navigator.userAgent || ''
const platform = navigator.platform || ''
// iPhone / iPad (旧 UA) / iPod
if (/iPhone|iPad|iPod/i.test(ua)) return true
// iPadOS 13+ 伪装为桌面 Mac通过触控判断
if (platform === 'MacIntel' && typeof navigator.maxTouchPoints === 'number' && navigator.maxTouchPoints > 1) return true
return false
})()
export const isAndroid = isAndroidClient
export const isIOS = isIOSClient
const OSS_HOST = 'aliyuncs.com'
const PROC_750 = 'image/resize,w_750,lfit/format,webp/q,85'