fix(weixin-sdk): fix iOS scanQRCode false camera permission error

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-09 16:49:01 +08:00
parent d8c240c839
commit 3d3588babb
6 changed files with 141 additions and 32 deletions
+12
View File
@@ -1,3 +1,15 @@
/** 是否 iOS 设备(不含微信开发者工具模拟器特殊处理) */
export function isIosDevice(): boolean {
if (typeof navigator === 'undefined') return false;
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !(window as Window & { MSStream?: unknown }).MSStream;
}
/** 是否微信开发者工具 */
export function isWechatDevTools(): boolean {
if (typeof navigator === 'undefined') return false;
return /wechatdevtools/i.test(navigator.userAgent);
}
/** 是否微信内置浏览器 */
export function isWechatBrowser(): boolean {
if (typeof navigator === 'undefined') return false;